We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26914
    • 8 Posts
    I haven’t tried this on a live server, but I’m assuming it shouldn’t work any differently. I just installed ModX, setup my templates, template variables and chunks, created child pages within a parent page and now want to display those child pages in a list on the parent page. Literally, what I’m doing is allowing the addition of locations for a restaurant chain by having the title be the name of the location, the content being the address and other contact info, and custom TVs for a location image, a map link and a site link. I’ve created the Ditto template (as a chunk) and named it location. The contents are as follows:
    						<li>
    							<img src="[+location_image+]" alt="[+pagetitle+]" />
    							<div class="details">
    								<h2>[+pagetitle+]</h2>
    								[+content+]
    								<p><a href="[~[+map_link+]~]">Maps & Directions</a><br />
    								<a href="[~[+location_site+]~]">Visit the website</a></p>
    							</div>
    						</li>
    


    The page’s template has a Ditto call that looks like this:
    [[Ditto? &parents=`47` &depth=`0` &display=`all` &sortBy=`createdon DESC` &tpl=`location`]]


    This isn’t outputting anything, despite there being three pages within the ID of 47. I’ve tried simplifying this as much as possible to see if it will get the child pages at all by using
    [[Ditto? &parents=`47` &display=`all`]]


    and that outputs the same thing (No documents found). What’s going on here? The only thing I can think of is that the ID is wrong, however when you are in the admin area, the left frame shows the locations page with a number 47 in parenthesis, and the three locations appear as children. Additionally, I can enter localhost/?id=47 and I see a page with the locations template being used.
      • 25483
      • 741 Posts
      Did you publish the documents? The standard setting is that you have to publish documents yourself. But you will see them when you are logged in into the manager.

      The secound thing: disable the cache of the document with the Ditto call, most of the time the cache is bitching with Ditto!
        with regards,

        Ronald Lokers
        'Front-end developer' @ h2o Media

        • 7231
        • 4,205 Posts
        Add &debug=`1` to the Ditto call to see what Ditto is seeing.

        Also is this a recent install? If it is not using Ditto 2.1 &orderBy will not work and you will need to use &sortBy and &sortDir instead.
          [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&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 26914
          • 8 Posts
          Ha! They weren’t published by default. Changing them to published worked. By disabling cacheing, is that only done in the page settings or also in the Ditto call? I’ve got cacheable unchecked on each and they work fine. Thanks!
            • 27708 MODX Staff
            • 2,502 Posts
            Shane you can snippets uncached. This is not necessarily related to the cacheing on the document. To call a snippet uncached you use this format:

            [!SnippetName? &param=`value`!] instead of the standard [[SnippetName? &param=`value`]]
              Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
              • 26914
              • 8 Posts
              Quote from: smashingred at Jan 07, 2009, 01:52 PM

              Shane you can snippets uncached. This is not necessarily related to the cacheing on the document. To call a snippet uncached you use this format:

              [!SnippetName? &param=`value`!] instead of the standard [!SnippetName? &param=`value`!]

              Wait, those two are the same. Do you mean to say use [!SnippetName? &param=`value`!] instead of [[SnippetName? &param=`value`]]?
                • 27708 MODX Staff
                • 2,502 Posts
                Shane,

                Sorry I fixed them. I was happy to add some assistance that I copied and pasted but forgot to change after the paste.

                Cheers,

                Jay
                  Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub