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

    I have a very strange issue with one production site : Ditto only outputs 3 children documents.
    I checked the source code and it is not only a display issue; no more than 3 documents are output.

    The same site exists as development site and Ditto displays there all children.

    Here's the code:
    <!--start of tabs area-->
    <div class="onglets" >
      <ul class="tabs">
      [[Ditto &startId=`[*id*]` &tpl=`onglet`  &orderBy=`menuindex ASC` ]]
      </ul>
    
      <!-- tab panes -->
      [[Ditto &startId=`[*id*]` &tpl=`panneau_onglet_76_22`  &orderBy=`menuindex ASC` ]]
    
    </div>
    <!--end of tabs area-->


    The production site is running MODX 1.0.15 on PHP 5.4.39.
    The development site is running MODx 1.0.14 on PHP 5.2.17.

    I can send the URLs as personal messages if someone wants to have a look; please send me a PM.

    Thanks.
    • Doesn't Ditto have a default limit that needs to be set to show more than 3?
        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
        • 16278
        • 928 Posts
        The default &display value for Ditto is `all`.

        I doubt whether the following has anything to do with the problem, but:
        - use &parents rather than the obsolete &startId. The latter works, because it's internally converted to &parents. With &parents, you can use mutiple parent folders
        - the default for &parents is the current location, so no need for &parents=`[*id*]`
        - when using multiple Ditto calls on a page, it's a good idea to use the &id parameter, to generate individual placeholders for each call (the value of &id becomes a prefix for the placeholders)

        You can get some idea of what Ditto is seeing and what it's doing with it using the parameter &debug=`1`, though it sometimes only generates the debug console when you twiddle with the caching.

        :) KP
        • Ah, I see. It's been a few years since I used it.
            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
            • 4172
            • 5,888 Posts
            from Ditto 2.0.2

            $display = isset($display) ? $display : 3;


            don't know, when it has changed
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 15001
              • 697 Posts
              Thanks.
              I also had the souvenir of what Susan mentions, but the development site shows that it works without.
              As kp52 mentions, Ditto's documentation tells that the default for &display is `all`.
              I had already tried all what kp52 mentions and server + browser caches were cleared.
              I even tried this paranoid code, but it doesn't change anything:
              <div class="onglets" >
                <ul class="tabs">
                [[Ditto? &parents=`98` &id=`myTabs` &limit=`10` &display=`10` &total=`10` &tpl=`onglet` &orderBy=`menuindex ASC` ]]
                </ul>
              
                <!-- les panneaux d'onglets -->
                [[Ditto? &parents=`98` &id=`myPanes` &limit=`10` &display=`10` &total=`10` &tpl=`panneau_onglet_76_22` &orderBy=`menuindex ASC` ]]
              </div>


              ... and the debug console shows some limit to a maximum of 3 ; see picture attached. [ed. note: Jul last edited this post 8 years, 3 months ago.]