Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for this question. It sounds like you would like to use the [mla_gallery] shortcode to display a “gallery” with the most recent PDF document, filtered by a partial name – is that right?

    Here is an example to get you started:

    [mla_gallery orderby=date order=DESC numberposts=1 s=raft post_mime_type=application/pdf size=icon link=file]

    In this example, orderby=date order=DESC numberposts=1 will sort the search results by upload date in descending order and then show only one result, the most recent or latest one. The post_mime_type=application/pdf parameter restricts the search to PDF documents.

    The s=raft parameter answers your “slightly different names” question. The search function automatically adds the wildcard specification, so “raft” will match, for example, “rafting”. Note that each word in the search specification is independent, so s="the raft" would match “these rafts”. You can find more information in the Codex entry for WP_Query under “keyword search”.

    I’ve added size=icon, which displays a PDF icon as the gallery thumbnail. You could code size=none or omit the parameter to use the title of the document as the “thumbnail”. I’ve also added link=file so clicking on the thumbnail will download the PDF document immediately. There are many [mla_gallery] parameters for specifying what the display contains.

    I hope that answers your question and meets your needs. I’m going to mark this issue resolved for now, but please let me know if you have any problems or further questions. I’m traveling until September 10, so there may be a delay in my responding. Thanks for your interest, your understanding and your patience. Enjoy the plugin.

    Thread Starter johnrance

    (@johnrance)

    David,
    Thanks for the prompt reply. It works fine. The next step is I would like the page to display the .pdf file content, not just the icon – can I embed it somehow?
    Kind regards,
    JR

    Plugin Author David Lingren

    (@dglingren)

    John,

    Glad to hear you’re making progress.

    There is nothing in MLA that will help you embed PDF content in a post or page. There are several other plugins that might help, such as Easy Fancybox. I haven’t tried them out, but if you find one that works well please let me know. If you have any issues integrating MLA with one of the “lightbox/fancybox” plugins, let me know. There are some earlier support topics about similar tasks that might help.

    Thanks for the update.

    Plugin Author David Lingren

    (@dglingren)

    John,

    Some time back I did some Easy Fancybox testing in the context of another MLA support topic:

    Slider Galleries

    Here is a working example of an [mla_gallery] shortcode that opens PDF documents in a pop-up shadowbox using Easy Fancybox:

    [mla_gallery post_mime_type=application/pdf post_parent=all link=file size=icon mla_caption='<a class="fancybox-iframe fancybox-pdf" href={+filelink_url+} target=_blank>{+title+}</a>' mla_link_attributes='class="fancybox-pdf fancybox-iframe"']

    The class="fancybox-pdf fancybox-iframe" parameters are used by the plugin to open the PDF documents when the icon or the caption links are clicked. I hope something like this will work in the context of your application. Good luck with it!

    Thread Starter johnrance

    (@johnrance)

    Hi Dave,
    Thanks, not having much luck with fancybox, but my searches are working a treat and the default viewing of pdf is working. I’ll try again with fancy box later,
    Happy Days,
    John

    Plugin Author David Lingren

    (@dglingren)

    John,

    Thanks for the update. If there’s anything I can do to help you with Easy Fancybox, let me know; it’s working well for me…

    Cheers,
    David

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘media search & display’ is closed to new replies.