• Resolved Greg Neise

    (@geneise)


    I’ve created a captioned PDF gallery that I would like to paginate. Here is the shortcode that works, as far as creating the gallery:

    [mla_gallery attachment_category=id-articles orderby="date DESC" columns=5 mla_viewer=true size=full post_mime_type=application/pdf post_parent=all link=file mla_target=_blank]
    mla_caption='<h3><a href="{+file_url+}" target="_blank">{+title+}</a></h3><h6><b>Species Mentioned: </b>{+terms:attachment_tag+}</h6><h6><b>Date: </b>{+date,date(Y-m-d)+}</h6>'
    [/mla_gallery]

    This code above displays all of the hundreds (and growing) files. What I would like to do is paginate the results in groups of 40. But when I use the following shortcode (which I’ve tried in various ways), it displays the pagination, but no files:

    [mla_gallery attachment_category=id-articles orderby="date DESC" columns=5 posts_per_page=40 mla_output="paginate_links,prev_next" mla_viewer=true size=full post_mime_type=application/pdf post_parent=all link=file]
    mla_caption='<h3><a href="{+file_url+}" target="_blank">{+title+}</a></h3><h6><b>Species Mentioned: </b>{+terms:attachment_tag+}</h6><h6><b>Date: </b>{+date,date(Y-m-d)+}</h6>'
    [/mla_gallery]

    I’m sure I’m missing or messing up something stupid, but no matter how I try formatting the shortcode, the result is the same.

    Any guidance is greatly appreciated.

    The page I need help with: [log in to see the link]

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

    (@dglingren)

    Good to hear from you again. Thanks for your question and for including the full source text of your shortcodes; very helpful.

    Your goal is similar to that described in the “An example of the paginate_links output type” section in the Settings/Media Library Assistant Documentation tab. The detail you’re missing is that you need two separate shortcodes, one for the pagination controls and one for the gallery display. They must have identical data selection parameters so the items retrieved by each shortcode are the same.

    Here are two shortcodes that should work for your application:

    [mla_gallery attachment_category=id-articles orderby="date DESC" posts_per_page=40 post_mime_type=application/pdf mla_output="paginate_links,prev_next" ] [/mla_gallery]
    [mla_gallery attachment_category=id-articles orderby="date DESC" posts_per_page=40 post_mime_type=application/pdf columns=5 mla_viewer=true size=full link=file mla_target=_blank] mla_caption='<h3><a href="{+file_url+}" target="_blank">{+title+}</a></h3><h6><b>Species Mentioned: </b>{+terms:attachment_tag+}</h6><h6><b>Date: </b>{+date,date(Y-m-d)+}</h6>' [/mla_gallery]
    
    

    I removed the post_parent=all because the attachment_category= parameter sets it automatically. I retained the [/mla_gallery] in the first shortcode because WordPress will combine the two shortcodes into one (corrupted) shortcode without it.

    I am marking this topic resolved, but please update it if you have problems or further questions regarding the suggested solution. Thanks for your continued interest in the plugin.

    Thread Starter Greg Neise

    (@geneise)

    That did it, thank you!!! I swear, I read that documentation until I was blue in the face, but didn’t pick that bit up about needing two separate shortcodes.

    One last thing, the pagination controls display vertical like this:

    1
    2
    3

    13
    Next>>

    Is there a way to format that so it’s horizontal, like:

    1 2 3 … 13 Next>>

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the good news regarding the changes I suggested. The pagination controls are simple hyperlink tags and normally appear as inline text, i.e., horizontal. The vertical pagination controls display is a result of the CSS styles your theme is applying. The controls have inherited a display: block style from somewhere. You will have to figure out some change in the Fusion page layout to prevent that.

    Thread Starter Greg Neise

    (@geneise)

    Again, thank you for your expertise, time, and wonderful product.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Paginate PDF Galler’ is closed to new replies.