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

    I am trying to make my site in modx revolution because I only want the site to do what I want and have no overhead.
    As I understand wayfinder is the way to go to create menu's.
    on my testsite www.actilist.net/modx my menu works exactly as I want
    EXCEPT that it doesn't show up in home.

    this is my wayfinder call:
      [[!Wayfinder? &startId=`11` &rowTpl=`rowCatMenuTpl`
    &outerTpl=`outerCatMenuTpl` &parentRowTpl=`parentRow`
    &hideSubMenus=`TRUE` 
    &excludeDocs=`0` 
    &firstClass=`Catmenu_first_class`
    &lastClass=`Catmenu_last_class`
    &rowClass=`Catmenu_row_class`
    &outerClass=`Catmenu_outer_class`]]
    

    atatched is my resource tree

    can anyone help me? [ed. note: djemmers last edited this post 14 years, 6 months ago.]
      www.tornooi.net online database for (sport) events in dutch.
      To be redesigned, rewritten to modx with multiple languages...
      ANY help appreciated, I cannot offer money but I can offer free advertising on the site. just message me.
      • 19369
      • 1,098 Posts
      Please wrap the Wayfinder call in the [ code ][ /code ] tag, you can find the "Insert code" button in the form.
        • 19369
        • 1,098 Posts
        I think that the problem is with hideSubMenus, can you try with this?
        [[!Wayfinder? 
        	&startId=`11` 
        	&rowTpl=`rowCatMenuTpl`
        	&outerTpl=`outerCatMenuTpl` 
        	&parentRowTpl=`parentRow`
        	&level=`1`
        	&excludeDocs=`0`
        	&firstClass=`Catmenu_first_class`
        	&lastClass=`Catmenu_last_class`
        	&rowClass=`Catmenu_row_class`
        	&outerClass=`Catmenu_outer_class`
        ]]


        or this:
        [[!Wayfinder? 
        	&startId=`11` 
        	&rowTpl=`rowCatMenuTpl`
        	&outerTpl=`outerCatMenuTpl` 
        	&parentRowTpl=`parentRow`
        	&hideSubMenus=`[[*id:isequalto=`1`:then=`0`:else=`1`]]`
                &level=`[[*id:isequalto=`1`:then=`1`:else=`0`]]`
        	&excludeDocs=`0`
        	&firstClass=`Catmenu_first_class`
        	&lastClass=`Catmenu_last_class`
        	&rowClass=`Catmenu_row_class`
        	&outerClass=`Catmenu_outer_class`
        ]]
          • 7575
          • 85 Posts
          the second one is exactly what I wanted!
          tnx a LOT !

          didn't know I could use if then else!
            www.tornooi.net online database for (sport) events in dutch.
            To be redesigned, rewritten to modx with multiple languages...
            ANY help appreciated, I cannot offer money but I can offer free advertising on the site. just message me.
            • 19369
            • 1,098 Posts
            It is a feature of MODX Revolution, they're Input and Output Filters.

            You can also use the if snippet or the andif snippet to accomplish similar tasks. You need to install them though, they're not installed by default.
              • 7575
              • 85 Posts
              now I have been working a bit more on my site
              I noticed that my wayfinder menu from above:
              [[!Wayfinder?
                  &startId=`11`
                  &rowTpl=`rowCatMenuTpl`
                  &outerTpl=`outerCatMenuTpl`
                  &parentRowTpl=`parentRow`
                  &hideSubMenus=`[[*id:isequalto=`1`:then=`0`:else=`1`]]`
                      &level=`[[*id:isequalto=`1`:then=`1`:else=`0`]]`
                  &excludeDocs=`0`
                  &firstClass=`Catmenu_first_class`
                  &lastClass=`Catmenu_last_class`
                  &rowClass=`Catmenu_row_class`
                  &outerClass=`Catmenu_outer_class`
              ]]

              it dissapears when I am not in resource 1, 11 or one of the subresources of 11
              but I want the first level of my menu to always be visible.
              even if I al not in one of the resources above.

              how do I do that?
                www.tornooi.net online database for (sport) events in dutch.
                To be redesigned, rewritten to modx with multiple languages...
                ANY help appreciated, I cannot offer money but I can offer free advertising on the site. just message me.
                • 19369
                • 1,098 Posts
                It is difficult to think of a solution without having an example where I can play with.
                I would either use the andif snippet with UltimateParent snippet to make it work depending on the page id, or use a different template and different wayfinder call (without the custom modifiers) when viewing the other pages.
                  • 19369
                  • 1,098 Posts
                  Can you try one of these and see if it works? You need to install the if snippet and the UltimateParent snippet:

                  [[!Wayfinder?
                      &startId=`11`
                      &rowTpl=`rowCatMenuTpl`
                      &outerTpl=`outerCatMenuTpl`
                      &parentRowTpl=`parentRow`
                      &hideSubMenus=`[[If? &subject=`[[UltimateParent? &topLevel=`1`]]` &operator=`=` &operand=`11` &then=`1` &else=`0`]]`
                          &level=`[[If? &subject=`[[UltimateParent? &topLevel=`1`]]` &operator=`=` &operand=`11` &then=`0` &else=`1`]]`
                      &excludeDocs=`0`
                      &firstClass=`Catmenu_first_class`
                      &lastClass=`Catmenu_last_class`
                      &rowClass=`Catmenu_row_class`
                      &outerClass=`Catmenu_outer_class`
                  ]]


                  [[!Wayfinder?
                      &startId=`11`
                      &rowTpl=`rowCatMenuTpl`
                      &outerTpl=`outerCatMenuTpl`
                      &parentRowTpl=`parentRow`
                      &hideSubMenus=`[[If? &subject=`[[UltimateParent? &topLevel=`2`]]` &operator=`=` &operand=`11` &then=`1` &else=`0`]]`
                          &level=`[[If? &subject=`[[UltimateParent? &topLevel=`2`]]` &operator=`=` &operand=`11` &then=`0` &else=`1`]]`
                      &excludeDocs=`0`
                      &firstClass=`Catmenu_first_class`
                      &lastClass=`Catmenu_last_class`
                      &rowClass=`Catmenu_row_class`
                      &outerClass=`Catmenu_outer_class`
                  ]]


                  [[!Wayfinder?
                      &startId=`11`
                      &rowTpl=`rowCatMenuTpl`
                      &outerTpl=`outerCatMenuTpl`
                      &parentRowTpl=`parentRow`
                      &hideSubMenus=`[[If? &subject=`[[UltimateParent? &topLevel=`3`]]` &operator=`=` &operand=`11` &then=`1` &else=`0`]]`
                          &level=`[[If? &subject=`[[UltimateParent? &topLevel=`3`]]` &operator=`=` &operand=`11` &then=`0` &else=`1`]]`
                      &excludeDocs=`0`
                      &firstClass=`Catmenu_first_class`
                      &lastClass=`Catmenu_last_class`
                      &rowClass=`Catmenu_row_class`
                      &outerClass=`Catmenu_outer_class`
                  ]]
                    • 7575
                    • 85 Posts
                    tnx! works now,
                    could you explain the topLevel parameter of ultimateparent?
                      www.tornooi.net online database for (sport) events in dutch.
                      To be redesigned, rewritten to modx with multiple languages...
                      ANY help appreciated, I cannot offer money but I can offer free advertising on the site. just message me.
                      • 19369
                      • 1,098 Posts
                      Ok. Let's suppose I have this website structure:

                      +home (1)
                      +services (2)
                      ++services 1 (6)
                      +++services 1 1 (9)
                      +++services 1 2 (10)
                      +++services 1 3 (11)
                      ++services 2 (7)
                      ++services 3 (8 )
                      +about (3)
                      +gallery (4)
                      +contact us (5)

                      If I use [ [UltimateParent? &topLevel=`1`] ], and I am browsing in any nested document inside "services (2)", the snippet will output the ID of the Ultimate Parent of those children, so the number 2. The same will happen with any other resource, it will always output the Ultimate Parent of children documents.

                      Note: I am not sure if the value of topLevel in that example is correct, maybe is 0 or maybe 2, I never remember where it star to count :p.