We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 3781
    • 24 Posts
    My problem seems to be similar to the one found here: http://modxcms.com/forums/index.php/topic,16051.0.html
    I’ve tried to make my problem a little more specific

    I’m building a CD library with this document structure:

    DISCOGRAPHY (29)
        BAND1
               CD1
               CD2
               CD3
        BAND2
               CD1
               CD2
               CD3
               CD4
               CD5
    


    Every BAND document has some information, eg. biography, band photo, members

    Every CD document is a child of some BAND and has information like cd code, title, release date, tracks

    My ditto call to get all CDs, but exclude every BAND (set to not "show in menu") document is:
    [!Ditto? &parents=`29` &format=`rss` &tpl=`discography_record_xml_tpl` &depth=`2` &display=`all` &hideFolders=`1` !]


    This is fine and works for listing all CDs, but I also want to list every BAND, with the band’s info AND each of it’s x number of CDs contained within a single XML output

    I tried putting the above ditto call into the chunk used by each BAND document with the hope of it executing for each
    eg.
    ...<RELEASES>[!Ditto? &parents=`29` &format=`rss` &tpl=`discography_record_xml_tpl` &depth=`2` &display=`all` &hideFolders=`1` !]</RELEASES>...


    - but the result is the actual ditto call text being outputted (as above)

    Any suggestions for this modx n00b? tongue
    I’ve only got this far from copying examples from here and there - the documentation and tutorials only help us n00bs so much sad

    cheers!
      • 18397
      • 3,250 Posts
      Are you saying you want a nested list like so:
      <artist>
      	<info>blah blah blah</info>
      	<releases>
      		<ablum>
      		<info>blah blah blah</info>
      		</album>
      	</releases>
      </artist>
      

      If so, its worth noting that Wayfinder is more suited to generating nested lists. Nevertheless, to get this working with Ditto your main call would look like this:
      [!Ditto? &parents=`29` &format=`rss` &tpl=`discography_record_xml_tpl` &display=`all`!]
      

      Then in discography_record_xml_tpl you would have
      ...
      <releases>
      [[Ditto? &parents=`[+id+]` &format=`rss` &tpl=`discography_releases`&display=`all`]]
      </releases>
      ...
      
        • 3781
        • 24 Posts
        fantastic! solved! laugh

        I was calling [!Ditto? &parents=`[+id+]` &format=`rss` &tpl=`discography_releases`&display=`all`!]

        instead of [[Ditto? &parents=`[+id+]` &format=`rss` &tpl=`discography_releases`&display=`all`]]

        [! not [[

        me=`n00b`

        thanks for that! ill look into Wayfinder smiley