We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28262
    • 3 Posts
    I have been looking at the documentation and trying to read the code to figure out what exactly &total, &limit, and &display mean. The documentation is very vague. How do these interact/relate to each other?

    Can somebody please explain the differences between them?

    For example, why does this return 1 result
    [!Ditto? &parents=`19` &display=`1` &tpl=`myTpl`!]

    but this returns 0 results?
    [!Ditto? &parents=`19` &limit=`1` &tpl=`myTpl`!]

    (I am trying to display the latest document in that folder).

    MODx version: 0.9.5
    Ditto version: 2.0.1
      • 18397
      • 3,250 Posts
      &display (which is &summarize in 2.0.1) is the number of documents Ditto should display.
      &total is the maximum number of documents to retrieve (say with pagination where &display controls the number of documents per page).
      &limit is an alias to MySQL’s limit and is for advanced uses only.
        • 28262
        • 3 Posts
        Can you explain the difference between &total and &limit in more detail? I know that &limit sets the LIMIT parameter in the SQL. What does &total do?
          • 18397
          • 3,250 Posts
          You should not worry about &limit (which is now &queryLimit per ticket #43) as this is mainly for situations with > 1000 documents.
          &total is the total number of documents Ditto can retrieve.
            • 25663 MODX Staff
            • 12,272 Posts
            Hey Mark, just out of curiosity, the sorting occurs prior to applying the &total constraint, right?
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
              • 18397
              • 3,250 Posts
              Yes it should.