Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Knut23

    (@knut23)

    Hi again!
    Nevermind, I solved it.

    Had some struggle with cusom fields, but here’s how I did it:
    On IPTC/EXIF: Go to “Add a new Field and Mapping Rule”. Put in the name you want for the custom field “mla_DateCreated”. Choose 2#055 date created in the first drop down. Write template:([+pdf:CreateDate+]) in the second one. Choose IPTC or EXIF, depending on which you want to prioritize. Choose Replace if you wnat the value to be overwritten when you update. Custom field done! If you want you can now map all your documents. To try it out first, upload a new document an try the mapping on that before you do them all.

    Now, go to your page where you want to sort documents.
    Include this in your shortcode:
    meta_key=mla_DateCreated orderby=meta_value order=DESC

    NB it seems that it matters where you put this in the shortcode. I tried to add it in the end first, but that did not work. So my complete sortcode looks something like this:
    [mla_gallery post_mime_type=application/pdf post_parent=all attachment_category='recipientkontroll' meta_key=mla_DateCreated orderby=meta_value order=DESC size=icon mla_image_attributes="width=32 height=32" link=file mla_style=mla_divrowsstyle mla_markup=mla_divrows columns=1]

    @david: Thanks for the plugin! And I hope you can correct me if I’m wrong in my explanation above… ??

    /Richard

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your question, for the work you did to answer it yourself and for taking the time to post your answer so others can benefit from it. There have been earlier topics about sorting on “date taken” for images, but this PDF example is a useful addition.

    You wrote “NB it seems that it matters where you put this in the shortcode. I tried to add it in the end first, but that did not work.” – The order of shortcode parameters does not matter as far as I know. Perhaps there was some other syntax problem that got corrected as you moved things around. Did you get an error message or just bad sorting?

    If you can reproduce the issue, let me know and I will look into it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sort pdf's by creation date’ is closed to new replies.