We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • My original snippet call (works lovely)

    [[!Gallery?
       &album=`Photos`
       &thumbTpl=`galItemThumbCustom`
       &containerTpl=`galOuterTpl`
       &thumbWidth=`160`
       &thumbHeight=`130`
       &limit=`15`
       &imageWidth=`800`
    ]]
    


    My snippet call + getPage (per documentation)
    [[!Gallery?
       &album=`Photos`
       &thumbTpl=`galItemThumbCustom`
       &containerTpl=`galOuterTpl`
       &thumbWidth=`160`
       &thumbHeight=`130`
       &limit=`15`
       &imageWidth=`800`
    ]]
    
    [[!getPage?
        &elementClass=`modSnippet`
        &element=`Gallery` 
        &totalVar=`gallery.total`
        &limit=`15`
        &album=`1`
        &pageVarKey=`page`
        &start=`page`
    ]]
    <div class="pageNav">[[!+page.nav]]</div>
    


    My Question
    How does one use Gallery with getPage to successfully create a simple pagination? The result above outputs both my normal gallery + a small thumbnail of the gallery (getPage, I assume is also pulling). The pagination links don't work, rather, the same images show up regardless of the page link.

    I've called just the getPage and the result is simply the same, the pagination links dont do anything.

    Are there clearer instructions on how to correctly do this?
      Sal Baldovinos
      SEO & DIGITAL MARKETING

      ARIEL DIGITAL | Maximize Your Potential
      www.arieldigitalmarketing.com
    • Update:

      After re-reading getPage rtfm, I realized I needed to combine my calls. So, now I have the following which displays what I want:

      <div id="gallery">
      [[!getPage?
          &elementClass=`modSnippet`
          &element=`Gallery` 
          
          &totalVar=`gallery.total`
          &pageVarKey=`page`
          
          &album=`Photos`
          &thumbTpl=`galItemThumbCustom`
          &containerTpl=`galOuterTpl`
          &thumbWidth=`160`
          &thumbHeight=`130`
          &limit=`15`
          &imageWidth=`800`
      ]]
      </div>
      


      Getting it to work
      Now my issue is getting the generated pagination links to work. As in, if I click "2" it should refresh the images for page 2.
        Sal Baldovinos
        SEO & DIGITAL MARKETING

        ARIEL DIGITAL | Maximize Your Potential
        www.arieldigitalmarketing.com
      • Gallery with no option & offset, which is used when calling getPage spipetov example getResource.
        Adding a line in the snippet getPage solves the problem:
        $properties['start'] = $properties['offset'];
          Valentin Rasulov - Industrial design (Hobbies - Web Development)
          Development not standard projects on CMF MODx Revolution.
          Small sample of extensions
          • Sal Baldovinos
            SEO & DIGITAL MARKETING

            ARIEL DIGITAL | Maximize Your Potential
            www.arieldigitalmarketing.com
          • Glad that solved the problem. smiley
              Valentin Rasulov - Industrial design (Hobbies - Web Development)
              Development not standard projects on CMF MODx Revolution.
              Small sample of extensions