We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7231
    • 4,205 Posts
    I notice that you don’t have either &parents or &documents parameters defined. Without this Ditto will not know what document to get. If nothing is set it defaults to the current document which will make both Ditto calls display the data from the same page.

    0x7B had the right idea but the wrong parameter. To force Ditto to get the data from a specific document regardless of the current document you need to add &document=`[+id+]` to the call ([+id+] will return the ID of the embedded document rather than the current document).

    It is a good idea to always define either parets or documents for Ditto.
      [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]
      • 5210
      • 43 Posts
      Ok, thanks. I tried changing the calls as follows:

      [[Ditto? &depth=`1` &display=`all` &orderBy=`menuindex asc` &tpl=`dittotccall` &parents=`[+id+]`]]


      ...and...

      [!Ditto? &tplFirst=`tabbedcontentpage1` &tpl=`tabbedcontentpage` &display=`all` &orderBy=`menuindex asc` &parents=`[+id+]`!]


      I expected this change to instruct Ditto to use the current page as the parent, which would mean it would display the content of the subpages of the current page. Right?

      For some reason, it’s displaying the entire document tree, so I see all of the pages all lumped together.

      Did I get the syntax wrong?

      Could this be because I’m inserting the Ditto calls into content fields that utilize the TinyMCE editor?

      Thanks

      Chris
        • 7231
        • 4,205 Posts
        On the current page (outer Ditto call) use the [*id*] syntax (it is not entirely required on the outer ditto call since it defaults to the current, but is required for the nested ditto call).

        Just wondering how the Ditto calls are nested? Is the nested call in the tpl of the outer call? or is the nested call in the content of the nested document?
          [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]
          • 5210
          • 43 Posts
          Hmm - Changing the [+id+] syntax to [*id*] didn’t result in any change. I changed the nested call first (no change), then the parent call (no change).

          The nested call is in the Content field of the child document.

          Chris
            • 3749
            • 24,544 Posts
            Quote from: chrison600 at Mar 28, 2009, 03:15 PM

            Hmm - Changing the [+id+] syntax to [*id*] didn’t result in any change. I changed the nested call first (no change), then the parent call (no change).

            The nested call is in the Content field of the child document.

            Chris

            Have you looked at the raw HTML code of the pages with the ditto calls? If the RTE is converting the tags to HTML entities, that would explain why the second Ditto call is not being parsed as a snippet.

              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 33337
              • 3,975 Posts
              Can you describe "visually" what you are trying to do?
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 5210
                • 43 Posts
                Sure:

                The ultimate goal is to use a combination of Wayfinder and Ditto to generate tabbed content. I’ve already got the Wayfinder calls set up to generate the <ul> as needed for the CSS and Javascript to work properly, so I’m working on the Ditto portion. I don’t necessarily HAVE to get nested Ditto calls to work, but it would be the most elegant solution, as it would allow the reordering of not only the tabs/panels in a tabbed content area, it would also allow entire tabbed content areas to be reordered if there were multiple tabbed content areas on one page.

                Nesting the divs and using MODx documents to "wrap" tabbed content also allows the CSS class calls to be a little more simple because they would be generated automatically as a part of the Ditto templates, rather than having to declare them explicitly in the page content.

                Does that help?

                Chris
                  • 33337
                  • 3,975 Posts
                  How about this, instead of putting the second call into the content of the sub pages, but in the ditto template:

                  [!Ditto? &parents=`3` &tpl=`categoryList`!]


                  tpl -> categoryList:
                  <div class="category">
                  <a href="[~[+id+]~]">[+pagetitle+]</a>
                  <div class="content">
                  [[Ditto? &parents=`[+id+]` &display=`all` &tpl=`categoryContent`]]
                  </div>
                  </div>


                  tpl -> categoryContent:
                  [+content+]


                  May be this would give some pointers?

                  I admit that I couldnt understand the exact thing you are looking for... may be my brain is not in the mood to process more Ditto solutions atm tongue
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link