We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32006
    • 12 Posts
    Hi All,

    I’ve got a question about the maxigallery pagination function.

    I’ve got a query with about 200 subpages, now everything is working, but i have 200 buttons in the pagination (1 for every page) and of course the previous and next button.

    The question is:
    Is it possible to paginate like this:

    prev | 1 | 2 | 3 | 4 | 5 | 6 | ...... | 200 | next

    thanks alot!
      • 7923
      • 4,213 Posts
      Not by default.. you’d need to do some coding.. easiest way would be to make a phx modifier to the pagination placeholder.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 32006
        • 12 Posts
        i hope someone can push me in the right direction... i don’t know where to start

        thanks for your help doze!
          • 32006
          • 12 Posts
          Anyone got an idea how to edit the pagination?

          doze i sent you a pm by the way!

          greetings
            • 7923
            • 4,213 Posts
            Yea, I saw your pm, I don’t have the time to do it..

            Basically what you need to do is to make a phx modifier to the pagenumbers placeholder, eg. replace the default [+maxigallery.pagenumbers+] placeholder with something like [+maxigallery.pagenumbers:stripnumbers=`[+maxigallery.pagecount+],[+maxigallery.currentpage+]`+] in galleryOuterTpl.

            then do a snippet called "phx:stripnumbers"
            <?php
            $pageOptions = explode(",", $options);
            $pageOptions[0]; // this has the content of [+maxigallery.pagecount+]
            $pageOptions[1]; // this has the content of [+maxigallery.currentpage+]
            $output; // this has the content of [+maxigallery.pagenumbers+], eg the html code of the page numbers
            
            // insert logic here to rip out unnecessary page numbers from the $output variable based on current page number and page count.
            
            return $output;
            ?>
            


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 32006
              • 12 Posts
              appreciate it doze, a lot.

              But i cant get my head around the pageOptions part, what part of [+maxigallery.pagecount+] and [+maxigallery.currentpage+] i have to put in the snippet.

              sorry to bother you with this, but i’m sure this modification will be usefull to others too.

                • 7923
                • 4,213 Posts
                The above code needs the logic to it to check how much pages there are and what is the current page and based on that information, strip out unnecessary pagenumbers from the $output variable. But as I said, I don’t have the time to do it.. post a bounty to the commercial inquiries thread if you don’t know hot to do it yourself.


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 20613
                  • 18 Posts
                  Did anyone get this working successfully?
                    • 19980 ☆ A M B ☆
                    • 275 Posts
                    Hi,

                    sorry for not updating this topic.

                    Yes, the MaxiGallery pagination was solved with catching it’s output and returning a formatted page numbers by a custom snippet.

                    Thanks.
                      modx and ecommerce pro
                      • 26931
                      • 2,314 Posts
                      sorry for not updating this topic.
                      Yes, the MaxiGallery pagination was solved with catching it’s output and returning a formatted page numbers by a custom snippet.
                      Thanks.
                      Hi modx.customize, would you like to share your Snippet code?