We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16702 ☆ A M B ☆
    • 536 Posts
    Hello,


    how i can counting a pages on tree with ditto?
    For example i have:

    Group (id = 166)
    -first
    -second
    -third
    -fourth
    -fifth

    (total pages: 5 )

    i need to extract number of pages
    but with [+total+] and [+totalpages+] not work for me...
      palma non sine pulvere
      • 16278
      • 928 Posts
      Are you using pagination? [+total+] and [+totalPages+] are empty unless &paginate=`1`. Using &paginate=`1` and (default) &display=`all` will give you the count of sub-documents in [+total+]. There can also be complications to do with caching.
      What does your Ditto call look like?
      smiley KP
        • 16702 ☆ A M B ☆
        • 536 Posts
        Quote from: kp52 at Jun 10, 2009, 06:24 AM

        Are you using pagination? [+total+] and [+totalPages+] are empty unless &paginate=`1`. Using &paginate=`1` and (default) &display=`all` will give you the count of sub-documents in [+total+]. There can also be complications to do with caching.
        What does your Ditto call look like?
        smiley KP

        good one...now working but have very strange new problem.
        first my ditto call now:
        [[Ditto? &startID=`166` &tpl=`rechnik_total` &paginate=`1` &display=`all`]]


        results is:
        (22222222222222222222222222222222222222222222)
        but a have just 22 pages in this group laugh it`s funny...where is now mistake?

        10x KP
          palma non sine pulvere
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Don’t know if that’s the cause of your problem, but any time you use &paginate with Ditto you should call it uncached, [!Ditto? ... !]
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 36416
            • 589 Posts
            Quote from: Kristalin at Jun 10, 2009, 06:35 AM

            good one...now working but have very strange new problem.
            first my ditto call now:
            [[Ditto? &startID=`166` &tpl=`rechnik_total` &paginate=`1` &display=`all`]]

            results is:
            (22222222222222222222222222222222222222222222)
            but a have just 22 pages in this group laugh it`s funny...where is now mistake?

            Placeholder [+total+] should be in the document after Ditto call, not in the Ditto template?
              • 16702 ☆ A M B ☆
              • 536 Posts
              Quote from: sottwell at Jun 10, 2009, 07:51 AM

              Don’t know if that’s the cause of your problem, but any time you use &paginate with Ditto you should call it uncached, [!Ditto? ... !]

              maybe,
              but when i use:
              [!Ditto? &startID=`166` &summarize=`all` &tpl=`rechnik` &orderBy=`pagetitle DESC` &paginate=`1` &display=`all`!]

              [+total+] - it does not work, when i use in cached mode [[]] everything work fine... rolleyes

              Quote from: Eol at Jun 10, 2009, 07:52 AM

              Quote from: Kristalin at Jun 10, 2009, 06:35 AM

              good one...now working but have very strange new problem.
              first my ditto call now:
              [[Ditto? &startID=`166` &tpl=`rechnik_total` &paginate=`1` &display=`all`]]

              results is:
              (22222222222222222222222222222222222222222222)
              but a have just 22 pages in this group laugh it`s funny...where is now mistake?

              Placeholder [+total+] should be in the document after Ditto call, not in the Ditto template?

              ooooo yep, yep (shame)
                palma non sine pulvere