We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31837
    • 59 Posts
    Hi guys,

    I’ve got a problem, and it’s a little more complicated than usual, so please bare with me as I try to explain.

    I’ve got a tree structure like this for example

    / homes (1)
    /name 1(2)
    /design 1 (3)
    /design 2 (4)
    /design 3 (5)

    /name 2 (5)
    /design 1 (6)
    /design 2 (7)
    /design 3 (8)

    /name 3 (9)
    /design 1 (10)
    /design 2 (11)
    /design 3 (12)


    What I want to do is when, click on say name 2 (id 5), it just lists the following:


    /name 1(2)

    /name 2 (5)
    /design 1 (6)
    /design 2 (7)
    /design 3 (8)

    /name 3 (9)


    or as similar if name 1 is clicked on then it only shows

    /name 1(2)
    /design 1 (3)
    /design 2 (4)
    /design 3 (5)

    /name 2 (5)

    /name 3 (9)

    I know it can be done, but I really need an example to show me.

    I’ve currently got a chunk like so:

    <div class="ditto_item" id="ditto_item_[+id+]">
    <div class="ditto_introText">[+introtext+]</div>
    </div>



    Called from:

    [[Ditto?parents=`1` &tpl=`dittoDwellingsSideMenu`]]

    I hope you are all following... smiley

    My guess is that this can be achieved by

    Doing a something like this, but I really need to know how to use the WHERE parameter.

    EG make a call like this on the side menu system of:

    [[Ditto?parents=`1` &tpl=`dittoDwellingsSideMenu2`]]


    Chunk to be called:


    <div class="ditto_item" id="ditto_item_[+id+]">
    <div class="ditto_introText">[+introtext+]</div>
    </div>



    [[Ditto? WHERE "the current page we are on = the parent ID "]]




    I hope this all makes sense. I’m going to play around, but I don’t know all of the MODX back end calls. So I will probably end up ripping out my hair.
    Any thoughts or answers would be very helpful.
    Thanks in advance!
    Steve.

      • 31837
      • 59 Posts
      well, I don’t want to have to do this, but I’m going to have to just make up a few custom templates to accomodate this idea.
      Unless someone knows how to pass variables and things around in an easy fashion, I don’t think I’m really going to be able to do this.
      If it were VB I wouldn’t have a prob. smiley
        • 36592
        • 970 Posts
        I think I didn’t understand what you meant correctly, but Wayfinder might fit your needs better than Ditto...
          • 18397
          • 3,250 Posts
          Ditto aggregates data and does not displays it linearly not hierarchically like a menu. Wayfinder was designed to display data hierarchically as you describe.

          If you don’t mind having your data in a list, Ditto can easily accomplish what you describe via the &filter parameter. See http://ditto.modxcms.com/tutorials/basic_filtering.html for more information.
            • 31837
            • 59 Posts
            thanks for the quick replies!

            I’ve done it a different way now.

            Case closed. smiley