We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9053
    • 18 Posts
    Hi all. Straight to the question - can such kind of pagination be made with Ditto:

    [1][2][3][4][5] ... [34][35][36]

    ?

    I mean, links in between are hidden and shown only then your’re on pages near to them. By default, all pages are shown. Solutions like limiting # of pages (&total) or creating an archive not good for me.
      "Sorry for my english"
      • 18397
      • 3,250 Posts
      Yes, with a snippet like this
        • 9053
        • 18 Posts
        This snippet outputs links even better than I wanted to =) Thank you Mark!

        There was a little trouble with making snippet work - links wasn’t splitted with such call:

        [[Ditto? &summarize=`3` &total=`77` &parents=`61,64,66,67,47` &depth=`5` &hideFolders=`1` &tpl=`np` &tplAlt=`npalt` &tplFirst=`npfirst` &paginateAlwaysShowLinks=`1` &extenders=`summary` &truncLen=`500` &truncOffset=`100` &truncText=`Читать далее...` &paginate=`1` &dateFormat=`%B %d %Y, %H:%M` &tplTrunc=`ditto_readmore` &hiddenFields=`news_source`]]

        [[splitPagination]]

        Cached and uncached, different settings for total and summarize were used. So I’ve change [+pages+] to [[splitPagination]] in my template, and modify last snippet string: "if ($return) return $ph;" to just "return $ph;".

        Maybe it’s not a correct way and i’m missing smth, but it working and me is happy :]
          "Sorry for my english"
          • 18397
          • 3,250 Posts
          The snippet above sets [+splitPages+] for you to use instead of [+pages+]. If you call it with &return=`1` it will return the value back to you instead of placing the output in a placeholder. Remember, never call pagination calls cached unless the page is uncached.
            • 9053
            • 18 Posts
            Thanks for clearing things. I think this snippet could be listed in repository or embedded in ditto.
              "Sorry for my english"
              • 10573
              • 101 Posts
              So will it read the splitter marker and make pages?
              Can I show section names instead of pages?

              Thanks,

              Gary

              [Edit] Removed quote for readability
                • 18397
                • 3,250 Posts
                This snippet is just a different version of [+pages+]. What do you mean by show section names?
                  • 10573
                  • 101 Posts
                  Quote from: Mark at Apr 16, 2007, 07:37 PM

                  This snippet is just a different version of [+pages+]. What do you mean by show section names?

                  Typically, I would have multiple documents in a folder, and use wayfinder or ditto to generate pages.
                  Section name would be the title of the page.

                  But let’s say there is one document that I want to split up.

                  Each page would be called by the section where I would put the split.
                  In this case, it would have to be the h3 or whatever header I put.

                  Hope that made sense.
                    • 10896
                    • 76 Posts
                    Ok. I’m not understanding the execution of this snippet. Can someone help me. I have the following in a document

                    [!Ditto? &parents=`46` &summarize=`10` &total=`20` &commentsChunk=`blog_CommentsBlog` &tpl=`blog_BlogTemplate` &dateSource=`pub_date` &dateFormat=`%m-%d-%Y` &sortBy=`pub_date` &paginate=`1` &paginateAlwaysShowLinks=`1` !]

                    [!splitPagination!]

                    I’m expecting a 2 page notification at the end of a list of 10 entries but it’s doing nothing. What am I doing wrong?

                    Thanks,
                    gl330k

                      • 33114
                      • 518 Posts
                      I have about 4000 docs to output with Ditto, so this snippet is the only way I can do pagination with (the usual [+pages+] simply won’t fit into screen). But splitPagination behave somewhat strange... it adds an extra page at start ([1][1][2][3]...) and the active page won’t turn into <span>, so we do not see the active page actually. Here is the page with my case: http://s31183.gridserver.com/news

                      Please help me with that... its kind of crucial for me smiley
                      Thanks in advance.
                        http://modx.ru - российская поддержка MODx
                        http://newscup.ru - экспериментальный проект
                        http://yentsun.com - персональный сайт