• Resolved steacha

    (@steacha)


    My apologies for the double-post, but I just noticed I posted in a ‘resolved’ thread. Posting it here so that David doesn’t miss it!

    —————-

    I am using the latest MLA and I am stuck with pagination. Above, you state that pagination requires some PHP coding and template development. Is it the case? I am asking because this is what I read in the MLA doc:

    “For most applications, “posts_per_page” is the only parameter you need to specify. Make sure this parameter is that same for your main gallery shortcode and for the pagination shortcodes that go with it.”

    I was under the impression that I could just add the following in a page and pagination would take care of itself:

    [mla_gallery post_mime_type=application/pdf attachment_category=’cat-1′ mla_caption=”{+description+}” orderby=”date DESC” size=icon link=file posts_per_page=10 mla_caption=”{+title+}”]

    Is this not the case?

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

    —————-

    Just to clarify what I am attempting to do:

    I have a bunch of galleries on the same WP page. Each of these galleries contains around 20 or so library items. I would like to see the pagination links under each gallery within the same WP page. For instance, say I have 3 galleries, it would be like this on the one page:

    Gallery 1
    library element 1 library element 2 library element 3…etc.
    Go to page: 1 | 2 | 3…

    Gallery 2
    library element 1 library element 2 library element 3…etc.
    Go to page: 1 | 2 | 3…

    Gallery 3
    library element 1 library element 2 library element 3…etc.
    Go to page: 1 | 2 | 3…

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

    (@dglingren)

    Thanks for your question, and for starting a new support topic to raise it. Paginating multiple galleries on a single WP page is a new and interesting question.

    First, regarding your posts_per_page comment; the MLA documentation you quoted is not perfectly clear (I’ll improve it). It should say something like “… is the only page selection parameter you need …”. The “Page selection parameters” section of the documentation is one part of the larger discussion of pagination in general. If you read through the rest of the documentation for the next_link, previous_link, next_page, previous_page and paginate_links output types and the examples you get a more complete picture of what’s required. At a minimum, you need to add [mla_gallery] shortcodes to format and display the pagination links you want. In your case, it looks like you want to use the paginate_links output type to get the “Go to page:” display below you galleries.

    Your example of multiple paginated galleries on one WP page is one I hadn’t thought of or tested. It is interesting because each of the galleries on the page could be on a different “gallery page”, e.g., Gallery 1 on gallery page 3 and Gallery 2 on gallery page 5. That means you must have a different mla_paginate_current value for each of your galleries. MLA can’t “manage this for you”; you’ll have to set up and pass distinct values for each gallery.

    It will take me some time to set up an example and test it out. I will leave this topic unresolved until I can update it with my findings. Of course, you can play around and you might beat me to a solution. If not, thanks for the stimulating idea and for your patience.

    Plugin Author David Lingren

    (@dglingren)

    My investigation and testing led me to the conclusion that the best way to satisfy the “multiple paginated galleries” requirement is to add a new parameter to the [mla_gallery] shortcode. The next MLA version will introduce mla_page_parameter, which changes the parameter used to track gallery page numbers from mla_paginate_current to another name for any single gallery.

    Here is my implementation of your example, using the new parameter. There are two galleries, one for “attachment_category=admin” and one for “attachment_category=teachers”. Each gallery has two [mla_gallery] shortcodes, one for the gallery itself and one for the pagination controls beneath the gallery.

    The new parameter, mla_page_parameter="mla_paginate_current_2", is added to the second gallery (both shortcodes) to give it a distinct name for the parameter that tracks the current page number for that gallery. That’s the only change required; MLA adds the appropriate current page parameters to the URLs it generates for each gallery page.

    Gallery 1:
    [mla_gallery post_parent=all post_mime_type=application/pdf size=icon link=file attachment_category=admin posts_per_page=1 mla_caption="{+file+}"]
    
    Go to page: [mla_gallery post_parent=all post_mime_type=application/pdf attachment_category=admin posts_per_page=1  mla_output="paginate_links,show_all"]
    
    Gallery 2:
    [mla_gallery post_parent=all post_mime_type=application/pdf size=icon link=file attachment_category=teachers posts_per_page=1 mla_caption="{+file+}" mla_page_parameter="mla_paginate_current_2"]
    
    Go to page: [mla_gallery post_parent=all post_mime_type=application/pdf attachment_category=teachers posts_per_page=1  mla_output="paginate_links,show_all" mla_page_parameter="mla_paginate_current_2"]

    As you can see by this example, no PHP coding or template modifications are required. The comments you found in the earlier support topic apply when the website theme includes PHP code for pagination in the theme-specific templates, or when a theme has specific template pages for category, tag or custom taxonomy display.

    I hope that gives you what you need to build your site. Watch for the new release in the next week or so (I’m finishing up some other fixes and enhancements). I will update this topic and mark it resolved when the next release goes out.

    If you have any problems with the new feature or any further questions, let me know. Thanks again for the question and for motivating a new MLA feature.

    Thread Starter steacha

    (@steacha)

    Hi David,

    Thank you for investigating this so promptly and for your update. Your solution seems very promising, I have another question:

    I was thinking of having each gallery (on the same page) be contained within their own ‘slide container’ such that when say page 2 is clicked on gallery 1, a sliding effect takes place to reveal the 2nd page of gallery 1 without gallery 2 and 3 being affected.

    Do you see this scenario adding much more complexity to the solution you’re proposing?

    Steacha: I think I understand. But there is a several BUT’s which I found as proper to ask before You or someone else want that.

    Solution: as David wrote.

    You can do that, but #1: How to link to it. Imagine you have first gallery on page 2 and second a third gallery on page 1. Or else. Unlimited combinations. So if you wan to link it you may have to make concerning URL. So finaly if the will be three galleries with Animals, Peoples and Plants how url would appers? gallery/animals?pageanimals=2&gallery2=plants&pageplants=2&gallery=peoples&pagepeoples=1 ? Imagine that even in nice urls: gallery/animals/page/2/also/peoples/page/1/plants/page/1 Dont you find it confusing? it is nightmare. If I will overstate it, it os like if you want all galleries on one page – even like if you would want have one url for whole your website – all your pages on one urls. I thing sense of galleries now is missing. Because for making multiple content of images on one page is better tagging and displaying them without pagination. Because isnt better to have 9 photos of all photographies on page than 3 x 3 and paginated separatelly? YOu can paginate alll your images even.

    ,but #2: If you not affect url, the urls will not be so bad but no one would be able to send link to another what he see right now.

    ,but #3: Url will be one, content will be multiplied. Its bad for seo.

    ,but #4: When there will be multiple galleries with ability to be listed, is not better to just make several images randomly put on page from certain category and after click on it runs into that certain gallery to that item and now to be able navigate in that category?

    ,but #5: Imagine the purpose of this. Three galleries on one page. Its nearly impossible to show it on full sized monitor screen even 1920x 1280… and if you will do that – images will be so small, that its loosing its avail to be made… And if images not be a full sized, they can be loggically small and without paginating – because they are small and they not need it. They fits in one page in any number…

    So why you can do like main pages with thumbs on all images from all categories clickable to go further?

    Sorry for this, but I want find solution not just for your question, but even for the future visitors of your pages, it should be important even for you…

    Plugin Author David Lingren

    (@dglingren)

    steacha,

    I will leave it to you to assess lrr’s comments on URLs and other aspects of your design.

    With regard to your question about slide effects, I don’t know of any way to have an entire gallery page slide from one page to another. The gallery pages are expressed in HTML; animating them would be a challenge. There are several plugins that animate single-image “slideshows” with effects, but nothing I know of operates at the page level.

    For example, MLA provides native support for the “Photonic Gallery” plugin. Here’s an example that uses Photonic to turn each gallery page into a separate slideshow:

    [mla_gallery post_parent=all size=thumbnail link=file attachment_category=admin posts_per_page=2 mla_caption="{+file+}" type='default' style="no-strip" fx="fade" slideshow_height='200' thumb_width='75' thumb_height='75' thumbnail_size='thumbnail' slide_size='thumbnail' timeout='4000' speed='1000']

    type, style and the parameters following them are passed from [mla_gallery] to Photonic and each page of the gallery is displayed as a self-running slide show. Many other parameters are available to control the display.

    MLA also works well with many of the “lightbox” plugins and other gallery plugins (such as Jetpack). You can find more information in the documentation and in some of the other support topics here.

    I hope that helps.

    Thread Starter steacha

    (@steacha)

    Lrrr, thank you for your comments, you do raise a few interesting points.

    Also, thanks for the info, David.

    Plugin Author David Lingren

    (@dglingren)

    I have released version 1.51; it includes the mla_page_parameter, which changes the parameter used to track gallery page numbers from mla_paginate_current to another name for any single gallery.

    I hope this new feature lets you implement the multiple galleries per page application you outlined in the earlier posts. Please let me know if you have any problems with this new feature or any further questions. Thanks again for your interest and for motivating this new feature.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Pagination’ is closed to new replies.