We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37059
    • 368 Posts
    I have a working Revo Gallery on which I would like to implement pagination. Here is the relevant part of my call:

    <ul>[[+page.nav]]</ul>
    
    [[!getPage?
    &elementClass=`modSnippet`
    &element=`Gallery`
    &limit=`2`
    &album=`1`
    &thumbWidth=`304`
    &thumbHeight=`180`
    &imageWidth=`912`
    &imageHeight=`540`
    ]]
    


    This results in only two Gallery entries showing, but no pagination appears in place of the [[+page.nav]] placeholder. To make sure there wasn’t anything fundamentally wrong, I did a quick test with getResources inside getPage rather than Gallery, executed on this same page instead of the existing call. It worked perfectly.

    Any help would be greatly appreciated as I really need this to work... thanks! smiley

    Running Gallery 1.1.0-pl with getPage 1.0.0-pl.
      Jason
      • 20135
      • 188 Posts
      Did this get resolved? I'm having the same issue.
        • 37516
        • 4 Posts
        I was able to resolve this by making the following modifications to the Gallery snippet!! I'd suggest, however, that you create a new snippet called GalleryPage or something. Make the following changes in the new snippet so you have the ability still to use Gallery both with and without getPage.

        I'm using Gallery1.5.0-pl.

        After...
        $start = $modx->getOption('start',$scriptProperties,0);

        on line 39, add...
        $start =& $offset;


        After...
        $count = $modx->getCount('galItem',$c);

        on what's now line 111, add...
        $modx->toPlaceholders(array("total" => $count));


        What this does, is instructs the "start" parameter in Gallery to read the "offset" parameter of getPage. Also, it sets the placeholder "total" with the total number of "rows" in the response. These are requirements of getPage.
        • Thanks for this. Helped out a lot in reference to my issue: http://forums.modx.com/thread/77365/gallery-pagination---how-to#dis-post-427042
            Sal Baldovinos
            SEO & DIGITAL MARKETING

            ARIEL DIGITAL | Maximize Your Potential
            www.arieldigitalmarketing.com
            • 40387
            • 28 Posts
            What to do in this case with Gallery 1.5.2?
              • 40387
              • 28 Posts
              What to do in this case with Gallery 1.5.2?
                • 40387
                • 28 Posts
                solved:

                add

                $properties['start'] = $properties['offset'];

                in snippet "getPage", line 17!
                  • 41647
                  • 49 Posts
                  working with gallery 1.5.2:

                  duplicated the gallery snippet and added:
                  $modx->toPlaceholders(array("total" => $data['total']));

                  as there was no "$count"-line i just added it before getpage did the output.

                  to get it working i also added:
                  $properties['start'] = $properties['offset'];

                  to the getPage snippet

                  thanks for the hints!