We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23491 ☆ A M B ☆
    • 1,056 Posts
    MODx 0.9.6-RC2 (rev 2409)
    Ditto 2.0.2 SVN


    I have a parent container called "Catalog". Within the catalog, I have two categories:

    - Category 1
    - Category 2

    ...and within each category, I have say 3 products each.

    That said, on the actual Catalog page, I am trying to output each available Category (active sub containers in Catalog), and then within that section, each product (sub document within CategoryX) This would be a summary template with image, price, title, etc

    So, I tried adding another Ditto snippet call inside the ’catalog_tpl’ chunk used in Catalog’s Ditto call: &tpl=`catalog_tpl`, only I pass the ID as startID...

    [!Ditto? &startID=`[+id+]` &tpl=`product_tpl` &showInMenuOnly=`1` &showPublishedOnly=`1` &depth=`1` &sortBy=`menuindex` &sortDir=`ASC` !]
    


    However, Ditto simply outputs the snippet call sad ...is there way to recurse via Ditto, or I guess group the way I am trying to? I guess I could create a snippet for outputting each category, and then go from there, but is there a way Ditto can make this easier w/o a need for separate snippet?

    Thanks!!

    UPDATE:

    Adding Ditto param of &depth=`3` does technically list the children, but I need a way to: Template the parent group diff. from product group ...can this even be done in Ditto?


    in the meantime, I guess I’ll just have to lose the dynamics @ the catalog level sad

    <h3><a href="[~14~]" title="Category 1">Category 1</a></h3>
    [!Ditto? &startID=`14` &tpl=`product_tpl` &showInMenuOnly=`1` &showPublishedOnly=`1` &depth=`3` &sortBy=`menuindex` &sortDir=`ASC` !]
    
    <h3><a href="[~15~]" title="Category 2">Category 2</a></h3>
    [!Ditto? &startID=`15` &tpl=`product_tpl` &showInMenuOnly=`1` &showPublishedOnly=`1` &depth=`3` &sortBy=`menuindex` &sortDir=`ASC` !]
    
      Mike Reid - www.pixelchutes.com
      MODx Ambassador / Contributor
      [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
      ________________________________
      Where every pixel matters.
      • 23491 ☆ A M B ☆
      • 1,056 Posts
      Thank you Mark!!

      I just needed to change [! to [[ on my dittoTpl snippet calls smiley ...I assume/hope that they still run uncached being that parent Ditto call is [!

      http://modxcms.com/forums/index.php/topic,12967.msg85774.html#msg85774
        Mike Reid - www.pixelchutes.com
        MODx Ambassador / Contributor
        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
        ________________________________
        Where every pixel matters.