We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39583
    • 103 Posts
    I have two context where I'm using the same wayfinder call like the following:

    [[!Wayfinder? &startId=`0` &outerClass=`menu` &parentClass=`parent` &hideSubMenus=`1` ]]


    In one context it works exactly as expected. In the second context the parent class is not added for the first level of items, but is strangely enough added on its children with children. Cache cleared both in modx and browser. and problem stays.

    Any ideas?
      --
      André
      • 3109 ☆ A M B ☆
      • 894 Posts
      Make sure your using the correct startId for the second context, I think that will solve your problem.
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 39583
        • 103 Posts
        Quote from: benmarte at Nov 28, 2012, 09:55 AM
        Make sure your using the correct startId for the second context, I think that will solve your problem.

        What should the startId be if the resources I want there are direct children of the context (web) and my other context?
        It says 0 for the root. Which is what I have in both cases.
          --
          André
          • 3109 ☆ A M B ☆
          • 894 Posts
          Make sure you are using &context that seems to be the issue, look at the &context &startIdContext parameters of wayfinder in the documentation.

          http://rtfm.modx.com/display/ADDON/Wayfinder
            Benjamin Marte
            Interactive Media Developer
            Follow Me on Twitter | Visit my site | Learn MODX
            • 39583
            • 103 Posts
            Thanks, but calling the wayfinder the following way makes no difference in the web context where the problem occurs. =(

            [[!Wayfinder? &startId=`0` &startIdContext=`0` &outerClass=`menu` &parentClass=`parent` &hideSubMenus=`1` &contexts=`web` ]]
              --
              André
              • 39583
              • 103 Posts
              No other suggestions anyone?
                --
                André
                • 39583
                • 103 Posts
                I really need help with this. Wayfinder ignores the first level of the menu where I need to add the class parent. I have two contexts. Web which is for german and a second for french (fr). When I make the following wayfinder call in the web context the first item named Menu1 should have the parent class.

                [[!Wayfinder? &startId=`0` &outerClass=`menu` &parentClass=`parent` &hideSubMenus=`1` &contexts=`web` ]]

                Result with wayfinder in web context:

                <ul class="menu_de">
                    <li class="first"><a href="#" >Home</a></li>
                    <li class="active"><a href="#" >Menu1</a>
                        <ul>
                            <li class="first"><a href="#" >Menu2</a></li>
                            <li><a href="#" >Menu12</a></li>
                            <li class="last parent active"><a href="#" >Menu2</a>
                                <ul>
                                    <li class="first"><a href="#" >Menu3</a></li>
                                    <li><a href="#" >Menu3</a></li>
                                    <li><a href="#" >Menu3</a></li>
                                    <li><a href="#" >Menu3</a></li>
                                    <li><a href="#" >Menu3</a></li>
                                    <li class="last active"><a href="#" >Menu3</a></li>
                                </ul>
                            </li>
                        </ul>
                    </li>
                    <li><a href="#" >Menu1</a></li>
                    <li><a href="#" >Menu1</a></li>
                    <li><a href="#" >Menu1</a></li>
                    <li><a href="#" >Menu1</a></li>
                    <li><a href="#" >Menu1</a></li>
                    <li class="last parent"><a href="#" >Menu1</a></li>
                </ul>
                


                If I make the exact same call but in the fr context changing &contexts=`fr` it works and this is the outcome:

                <ul class="menu_de">
                    <li class="first"><a href="#" >Home</a></li>
                    <li class="parent active"><a href="#" >Menu1</a>
                        <ul>
                            <li class="first"><a href="#" >Menu2</a></li>
                            <li><a href="#" >Menu12</a></li>
                            <li class="last parent active"><a href="#" >Menu2</a>
                                <ul>
                                    <li class="first"><a href="#" >Menu3</a></li>
                                    <li><a href="#" >Menu3</a></li>
                                    <li><a href="#" >Menu3</a></li>
                                    <li><a href="#" >Menu3</a></li>
                                    <li><a href="#" >Menu3</a></li>
                                    <li class="last active"><a href="#" >Menu3</a></li>
                                </ul>
                            </li>
                        </ul>
                    </li>
                    <li><a href="#" >Menu1</a></li>
                    <li><a href="#" >Menu1</a></li>
                    <li><a href="#" >Menu1</a></li>
                    <li><a href="#" >Menu1</a></li>
                    <li><a href="#" >Menu1</a></li>
                    <li class="last parent"><a href="#" >Menu1</a></li>
                </ul>
                


                base_url and site_url are both specified for both contexts. And If I use the rowTpls I still get the same problem for the first level items.
                Does anyone know what could cause this?
                  --
                  André
                  • 22427
                  • 793 Posts
                  Check the Settings of your resources, especially the Container checkbox.

                  Cited from ottogal :: ymodx, the hint to the parentClass:
                  Wayfinder assigns this class to a <li> element if it fulfills two conditions:

                  1. It has the property Container (under the Page Settings of the document).
                  2. In case the value of &level is not equal to 0: It is not on the lowest of the displayed levels.
                  ...

                  If a resource has children, it automatically has the property Container.
                  However, the checkbox Container may be ticked also in the case of no existing child documents.
                  E.g., if you delete all the children of a resource, or move them to another location in the menu tree by changing their Parent Resource, the property Container of the resource will not get lost; occasionally you have to untick the checkbox manually.