On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • I’m finding the solution how to create pagination in the Gallery snippet for modx Revolution.

    I use this code in my template:

    [[!Gallery? &album=`1` &thumbWidth=`100` thumbHeight=`100` &plugin=`colorbox` &imageWidth=700 &imageHeight=`700`]]


    When there are too many photos in album it will shown on one page. Somebody knows how to add a pagination?
      • Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
      • Quote from: zi at Aug 01, 2010, 02:17 PM

        I guess you need to use getPage snippet. Please see http://svn.modxcms.com/docs/display/ADDON/getresources#getResources-UsinggetPageforPagination

        Thanks. But, obviously, the Gallery snippet doesn’t support the getPage snippet (no total placeholder and no offset parameter are defined). If somebody knows how to modif the Gallery snippet to create pagination, please help me.

        Thanks in advance..
        • Looking at the code I can see it does support pagination, please see http://github.com/splittingred/Gallery/blob/master/core/components/gallery/model/gallery/gallery.class.php#L216

          I haven’t used it myself yet, sad
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
          • Look here,

            Most of it working:

            See all gallery’s in http://modx.hurby.com/portfolio/gallery/
            there are 4, don’t mind the layout please it’s far from done, but working

            Two off them got problems:

            next and back buttons not working in example 4, why i don’t no,
            It looks like a bug in java because example 3 is working fine the same but less functions.
            I guess the extra functions (add, remove image) are buggy.

            Example one is a basic implementation off the gallerific plugin. Here the images aren,t showing. Posted a message with some extra files.
            Maybe it will give you some help to hold on and make the pagination work.
              Sommige mensen hebben aan een half woord genoeg
            • Not a solution to all of ur issues, but I have logged the feature request for getPage (pagination) support at http://github.com/splittingred/Gallery/issues/#issue/26

              As I mentioned before, havent played with the Gallery myself yet, but I hope Shaun will shed some light on your issues.

              regards.
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
              • Sorry good not help you,
                I have the same probs in my blog on the same website as the galley

                Hope we will get the extra Current state soon, it’s importend for nice user interface.

                grtz
                Hu
                  Sommige mensen hebben aan een half woord genoeg
                • Thanks to all. I’ve found the temporary solution. May be it will be helpfull for somebody. Here it is:

                  in snippet Gallery:
                  find
                  $start = $modx->getOption('start',$scriptProperties,0);
                  
                  replace with
                  $start = $modx->getOption('offset',$scriptProperties,0);
                  


                  find
                  if (!empty($limit)) $c->limit($limit,$start);
                  
                  BEFORE add:
                  $total = $modx->getCount('galItem',$c); //get total amount for the getPage snippet
                  $modx->setPlaceholder('total', $total); // set total amount for the getPage snippet
                  


                  my snippet call:
                  [[!getPage?   
                      &elementClass=`modSnippet`  
                      &element=`Gallery`
                      &totalVar=`total`
                      &limit=`20` 
                      &album=`1` &thumbWidth=`100` thumbHeight=`100` &plugin=`colorbox` &imageWidth=700 &imageHeight=`700`]]
                  <div class="paging">  
                  <ul class="pageList">  
                     [[!+page.nav]]  
                  </ul>
                  </div> 
                  
                  • In new version was added -> "total property to Gallery snippet for getPage support" but pagination it is not working...

                    istislav`s method is WORKING, but I have used "start" option, and I should to replase it to "offset"... it be cool if I find way to use addition functionality in Gallery 1.1.0
                    • Hi

                      I tried istislav`s method, but the pagination is visible only to the first page, not in the following page=2 ...
                      I’m using Gallery 1.2.1 and getPage 1.1.0
                        ----------------------------------
                        canale irc Italiano #modx server: tophost.azzurra.org