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

    (@dglingren)

    Thank you for the question and for taking the time to include the source text of your shortcode; that is very helpful.

    When you say “a pagination bar for my pdf files“, I understand that to mean that you want to divide the [mla_gallery] display into pages and include controls to let users move among the pages of gallery output. If that is what you mean, MLA can help. You can add one or two additional [mla_gallery] shortcodes to the page that will display the pagination bar you need.

    To display one set of controls you can simply add a second shortcode to your post/page:

    [mla_gallery attachment_category='revue-de-presse-2' post_mime_type=all link=file mla_style=leftalign posts_per_page=10]
    
    [mla_gallery attachment_category='revue-de-presse-2' post_mime_type=all posts_per_page=10 mla_output="paginate_links,prev_next"]

    I have added posts_per_page=10 to your original shortcode, to divide the gallery into pages of ten items each. I have added a second shortcode to generate the pagination bar. The mla_output="paginate_links,prev_next" parameter changes the output from gallery items to pagination controls and selects the type of controls.

    The attachment_category='revue-de-presse-2' and post_mime_type=all parameters are the same for both shortcodes. This is important because the same set of items must be selected for both. The pagination bar does not display items, so the link=file and mla_style=leftalign parameters are not needed in the second shortcode.

    To display separate “previous page” and “next page” controls you can use two additional shortcodes:

    [mla_gallery attachment_category='revue-de-presse-2' post_mime_type=all link=file mla_style=leftalign posts_per_page=10]
    
    <div style="clear: both; float: left">
    [mla_gallery attachment_category='revue-de-presse-2' post_mime_type=all posts_per_page=10 mla_output="previous_page,first" mla_link_text='&larr;' mla_rollover_text="Previous/first page"]
    </div>
    
    <div style="float: right">
    [mla_gallery attachment_category='revue-de-presse-2' post_mime_type=all posts_per_page=10 mla_output="next_page,last" mla_link_text='&rarr;' mla_rollover_text="Next/last page"]
    </div>

    There are many parameters you can add to the pagination shortcodes to change the display. You can find more information in the “Support for Alternative Gallery Output, e.g., Pagination” section of the Settings/Media Library Assistant Documentation tab.

    I hope that gets you started on adding controls to your post/page to paginate your gallery. I am marking this topic resolved, but please update it if I have not understood your question or if you have other problems/questions about gallery pagination. Thank you for your interest in the plugin.

    Thread Starter marielle aj

    (@marielle-aj)

    Thank you so much that code helped me a lot.
    just one more question if you don’t mind.
    is there a way to add more information to be displayed?
    for example, now we can see the “Caption” but can we add also the description?

    Plugin Author David Lingren

    (@dglingren)

    Thanks for your update and the good news about your progress. I am happy you found the code examples useful.

    There are two ways you can add more information to your gallery display. For simple applications you can use the mla_caption parameter to change the caption returned for each item. For example, you can use Description in place of Caption by coding mla_caption="{+description+}". For more intelligent enhancements you can use a Content Template:

    mla_caption="{+template:{+caption+} - {+description+}|{+description+}|{+caption+}+}"

    In this example:

    • The template: prefix says that this is a Content Template
    • The vertical bar “|” between the elements means “stop when you get a non-empty alternative

    You can read all about it in the “Content Templates” section of the Settings/Media Library Assistant Documentation tab, but the example should work as-is.

    If you want to include some HTML tags in your caption, such as <br>, make sure you use the “Text” tab of the editor, not the “Visual” tab.

    If you want to do more elaborate formatting of your gallery items, such as including many HTML tags or styles, you can use custom Style and Markup templates. These are described in the Documentation tab and an example is given in the “A table-based Style and Markup template example” section of the Documentation.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘pagination for PDF in Media Library Assistant’ is closed to new replies.