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

    I use Ditto to create menu navigation list, so i want to use one template with more then one depth.

    For example:

    (*) Blog [id 1]
    -|
    -|
    -|--- (*) example_1 [id 3]
    -|
    -|--- (*) example_2 [id 4]
    -------|
    -------|---(*) example_4 [id 6]
    -|
    -|---(*) example_3 [id 5]
    -|
    (*) About us [id 2]

    So if i want display "Blog" and "About" links in example_1,_2 and _3 i simply use:

    Ditto? &parents=`[*parent*]` (of course i can use id number as parents but then i need to create many different tempaltes :/)

    My questin is what i need to do, if i want display the same links "Blog" and "About" in "example_4" with ditto doubled parent: &parents=`[*parent*][*parent*]` ??
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Use the Ultimate Parent snippet for that.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 46526
        • 21 Posts
        Thx for replay, but i dont rly know what u mean, can u give more advice?
        Thx a lot.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 46526
            • 21 Posts
            Thx a lot, it almost works like a charm, but when i use ditto parents as:

            [!Ditto? &id=`nav` &parents=`[[UltimateParent? &topLevel=`2`]]` &orderBy=`menuindex ASC` &showInMenuOnly=`1` &display=`15` &tpl=`nav` &tplCurrentDocument=`nav_cur`!]

            It seems it doesnt includes -> &tplCurrentDocument=`nav_cur`

            tplCurrent nav_cur <-- it will add green arrow img on current link in navigation menu.

            Why they doesnt work with UltimateParent? &topLevel=`2` ?