We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13613
    • 23 Posts
    I have this bit of Ditto which basically parses a ’category’ in my Foxy Cart shop

    [!Ditto? &parents=`12` &display=`8` &tpl=`product_display_brief` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`0` !]

    The bit that is bothering me I have highlighted.

    Obviously I would like more than one category and would like a chunk that deals with that dynamically. The alternative is me having to hard code a new chunk for each category - I’d like the client to be able to just create a new category folder and away they go.

    I’m sure there is a simple solution to this but bare in mind I’m very new to modx.

    Thanks

    Jase
      • 26016
      • 561 Posts
      Hi,
      Welcome to MODx. I’m not absolutely sure I follow you, but I’ll describe one scenario. Let’s say your Ditto call is in a document, and that its children documents are the ones you’d like to display.

      Your Ditto call could begin like this, and could be contained in a template or chunk. It makes "itself" become the root:

      [!Ditto? &parents=`[*id*]` ....


      Another way is by making a TV (template variable) and assigning it to the template you’ll be using. Then use the TV in your Ditto call, and then each document will allow you to pick the root by entering a number in the TV (once you’ve created a document so you know what the number is.)

      [!Ditto? &parents=`[*MyBrandNewTV*]` ....


      I hope that made sense and is helpful.

      Cheers, Dave
        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 13613
        • 23 Posts
        Thanks Samba, the first option worked perfectly.
        smiley
          • 26016
          • 561 Posts
          Jason,
          Glad to hear that worked! It took me a long time to figure out Ditto’s personality, even with documentation, so I like to help people out with it when I can.

          Once you have enough arrows in your back to bring immunity, you find that Ditto can be used for zillions of situations; it’s possibly the most versatile of MODx tools.

            MODx and Wordpress development
            Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
            • 5340
            • 1,624 Posts
            Quote from: samba at Mar 18, 2010, 09:18 AM

            Jason,
            Glad to hear that worked! It took me a long time to figure out Ditto’s personality, even with documentation, so I like to help people out with it when I can.

            Once you have enough arrows in your back to bring immunity, you find that Ditto can be used for zillions of situations; it’s possibly the most versatile of MODx tools.



            sometimes it can replace Wayfinder smiley