• Resolved mohamed0walid

    (@mohamed0walid)


    Hi there! I have a questions that you may be able to answer. i’m creating a website for a newspaper , and i have to make a gallery that includes the latests newspapers in pdf extensions ,and only show the thumbnail , the newspapers are sorted by date and the number , so :

    how to upload the documents ? how to include the documents in the gallery and the gallery in the page ?how to sort documents ?

    NB: sorry for my english

    https://wordpress.org/plugins/media-library-assistant/

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

    (@dglingren)

    Thanks for your questions.

    You asked “how to upload the documents?” You can use the Media/Add New (Upload new media) admin screen to upload PDF documents and add them to the Media Library. The process is the same as for images and other types of media.

    You asked “how to include the documents in the gallery and the gallery in the page?” You can use the [mla_gallery] shortcode to compose a gallery of your documents. For example, you can code something along these lines:

    [mla_gallery post_mime_type=application/pdf post_parent=all]
    
    [mla_gallery post_mime_type=application/pdf post_parent=all size=icon link=file]
    
    [mla_gallery post_mime_type=application/pdf post_parent=all size=icon link=file mla_caption="{+template:({+caption+}|{+title+})+}"]

    The post_mime_type=application/pdf parameter changes the gallery from images to PDF documents. The post_parent=all' parameter removes the default requirement that the items are "attached" to the post/page in which the shortcode appears. Thesize=iconparameter replaces the document title with an appropriate icon. The 'link=file parameter generates a direct link to the document file. The mla_caption="{+template:({+caption+}|{+title+})+}" substitutes the document title for the Caption for items that do not have a Caption value.

    You can find more information in the “MLA Gallery Shortcode” section of the Settings/Media Library Assistant Documentation tab. You might also be interested in the “Thumbnail Substitution Support, mla_viewer” section of the Documentation, which tells how to generate a “thumbnail” image in place of the PDF icon.

    You asked “how to sort documents?” You can use the “Order, Orderby” parameters to sort the gallery.

    You can also use the MLA taxonomy support to assign terms, e.g., Att. Categories and Att. Tags to your documents and filter the gallery display by term values.

    Here are links to two earlier topics you might find useful:

    Basic pdf list with pdf icons

    Simple list

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding the above suggestions. Good luck with your application and thanks for your interest in the plugin.

    Thread Starter mohamed0walid

    (@mohamed0walid)

    Hi , thank you so much for your very detailed and helpful response and the amazing plugin .
    i’ve other questions sir :

    first ,how to make the first image of the pdf or loaded image as thumbnail (in the place of the current pdf icon)
    second , i want to show in the gallery just the last pdf uploaded , and the client can choose a date or a number of the pdf to show in other page.
    this is a view of what i want to realise :
    here

    thank you for your disponibility and please excuse for my english i’m arabic .

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your kind words and the additional questions. Thanks as well for the link to your desired results; very helpful. Your English is fine – certainly better than my Arabic!

    Regarding your first question, you can generate a thumbnail from the first page of a PDF document with a shortcode like this example:

    [mla_gallery post_mime_type=application/pdf post_parent=all mla_viewer=true link=file]

    As you can see I have simply replaced size=icon with mla_viewer=true. However, you must have the proper software on your server for this to work. As the Documentation says:

    The dynamic thumbnail image generation for PDF and Postscript documents uses the PHP Imagick class, which requires ImageMagick and Ghostscript to be installed on your server. If you need help installing them, look at this PDF Thumbnails support topic. If you don’t have them on your server you can still use the Featured Image support to supply thumbnails for your non-image items.

    You can find more information in the “Thumbnail Substitution Support, mla_viewer” section of the Settings/Media Library Assistant Documentation tab.

    Regarding your second question, displaying the most recent document is straightforward:

    [mla_gallery post_mime_type=application/pdf post_parent=all mla_viewer=true link=file orderby=date order=DESC numberposts=1]

    The above sorts the gallery by date uploaded in descending order and displays one document (the most recent upload). Of course, this assumes that you upload the documents in the right order.

    Your desire to “choose a date or a number of the pdf ” is more complicated. To do that you will first need to store the publication date and the number of each document somewhere in the database. I suggest you create two custom taxonomies, one for publication date and one for document number. If you do that you can use the [mla_term_list] shortcode to generate a dropdown control of the type you show in your example. Here is a recent support topic along those lines:

    Limiting search results to attachment tags/”Justifying” gallery grids

    If you have another source for your publication date and number values, let me know. I can give you more specific help when I know more about your application.

    Thread Starter mohamed0walid

    (@mohamed0walid)

    Hi , thank you so much for your responses it helps me a lot ,

    for the last question , when i use [mla_term_list] i have this message in my page :: mla_output is empty .
    this is my pdf page : http://elbatal-douali.com/wordpress/ar/pdf/
    and this what i want to display :https://drive.google.com/open?id=0BxGs3ofCb3LfV1VNRVJ4TVV5bGs

    another question : when i click on the pdf i want it to link to the post how to achieve that ?

    thank you again sir .

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the good words. Regarding the “mla_output is empty” output, it looks like you have not supplied any of the parameters that [mla_term_list] needs to give you the right kind of list or control for your application. I encourage you to read through the “MLA Term List Shortcode” sections of the Settings/Media Library Assistant Documentation tab and the support topic I linked to in my post to understand how it works.

    For [mla_term_list] in your application you will need to first set up the taxonomies for publication date and number. You can then use them in shortcodes similar to this one:

    [mla_term_list taxonomy=publication_date mla_output=dropdown]

    Finally, you will have to work out a way to pass the selected term(s) back to an [mla_gallery] shortcode to generate the gallery. That is the subject of the earlier topic. It will require some work to construct a solution that works for your application.

    Of course, you can also build a solution in other ways. You can write some PHP code to process the year, month and day selections when the “Voir” button on the form you show in your display image. The code could use the values to create a query that returns the right document. The query would depend on how the date values are stored in the database. I proposed using custom taxonomies but you could use a custom field instead. Whatever you decide, you will need some programming experience to get the job done. MLA can help but it cannot do the complete job.

    You wrote “when i click on the pdf i want it to link to the post“. If you code link=page, the link will go to the “attachment page” for the document. If you mean something else by “the post” you may be able to use the mla_link_href parameter to build a link to another destination.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘gallery of pdf's’ is closed to new replies.