We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 15083
    • 697 Posts
    Pardon the title....for some reason my DITTO call is having an undesired effect!

    [!Ditto? &startID=`11` &tpl=`newstpl` &extenders=`summary` &total=`5` &showInMenuOnly=`1` !]

    I am trying to call ditto to list 5 children of parent 11.
    Ditto is doing this, however it is ignoring the parameter &showInMenuOnly=`1`
    If I un-check "show in menu" DITTO still pulls through the children?
    I can’t see a problem with the snippet call?

      • 1122
      • 209 Posts
      "startID" is not a Ditto’s parameter -- you shoul write &parents=`11`
        • 15083
        • 697 Posts
        Quote from: Alik at Jun 29, 2009, 10:20 AM

        "startID" is not a Ditto’s parameter -- you shoul write &parents=`11`

        could have fooled me smiley

        if (isset($startID)) {$parents = $startID;}
        Appears it in there for legacy support, so its not related to my problem.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I know the feeling... had a husband and three teenaged boys rolleyes rolleyes That’s why I took up computers - they always do exactly what you tell them to. The only problem is that I find I’ve often not told it to do what I thought I did grin

          Anyway...

          I believe that &display would server you better than &total; &display tells it how many to list, &total tells it how many to fetch from the database. You can use &depth to indicate how deep into your tree structure you want it to go.

          This may be useful http://ditto.modxcms.com/files/snippet-ditto-php.html
            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
            • 7231
            • 4,205 Posts
            maybe change total to display
            &display=`5`


            What is your objective? Are you trying to not show the parent but only the children? Or are you trying to exclude a section based on the show in menu option? Or something else all together wink
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don't know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 15083
              • 697 Posts
              I am trying to exclude the children who have no show in menu.
              In fact, its working now, don’t know what I changed....but here is the new call that is working:

              [!Ditto? &parents=`11` &tpl=`newstpl` &extenders=`summary` &display=`3` &showInMenuOnly=`1` &depth=`1` !]

              Thanks for the help again guys, if only it was as simple to switch off other things.....
              &projectmanager=`0`

              ONLY JOKING smiley smiley smiley