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

    Currently I use this Wafyinder call:
    [[!Wayfinder? &startId=`[[BabelTranslation? &resourceId=`[[*Bovenliggend_menu_item]]` &contextKey=`[[*context_key]]`]]` &level=`2` &outerTpl=`wayfinder_sbs_algemeen_left_outertpl` &hideSubMenus=`1` &innerRowTpl=`wayfinder_sbs_pages_innerRow` ]]


    Which generated the correct menu, except the submenu items. The menu is currently structured as:
    <ul>
     <li>First level 1</li>
     <li>First level 2</li>
     <ul>
      <li>Second level 2.1</li>
      <li>Second level 2.2</li>
     </ul>
     <li>First level 3</li>
     <li>First level 4</li>
    </ul>


    I would like to get this as output:
    <ul>
     <li>First level 1</li>
     <li>First level 2</li>
     <li>Second level 2.1</li>
     <li>Second level 2.2</li>
     <li>First level 3</li>
     <li>First level 4</li>
    </ul>


    The template chunks:
    wayfinder_sbs_algemeen_left_outertpl
    <ul id="wayfinder_sbs_algemeen_left">[[+wf.wrapper]]
    </ul>


    Wayfinder_sbs_pages_innerRow
    <li><a class="hg" href="[[+wf.link]]">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>


    Can someone point me in the correct direction to get the content as described.
    I need the &hideSubMenus option for hiding the inactive menu-items like 1.1 1.2 3.1 4.1.

    Thanks

    This question has been answered by ottogal. See the first response.

    • discuss.answer
      • 22427
      • 793 Posts
      Remove the ul tag from the outerTpl and wrap it around the Wayfinder call instead:

      outerTpl:
      [[+wf.wrapper]]

      Source code:
      <ul id="wayfinder_sbs_algemeen_left">
      [[!Wayfinder? &startId=`[[BabelTranslation? &resourceId=`[[*Bovenliggend_menu_item]]` &contextKey=`[[*context_key]]`]]` &level=`2` &outerTpl=`wayfinder_sbs_algemeen_left_outertpl` &hideSubMenus=`1` &innerRowTpl=`wayfinder_sbs_pages_innerRow` ]]
      </ul>
        • 32412
        • 21 Posts
        Thanks, that seems to solve my issue.

        Is't also be possible to add a class=current to the <li> or <a> of the submenu (second level)?
        For the first level, it showed this already, but the "Firs level 2" remains active if you open "Second level 2.1". And "second level 2.1" isn't marked as active.
          • 22427
          • 793 Posts
          For that purpose there is the parameter &selfClass:
          [[!Wayfinder? .... &selfClass=`current`]]
          This will assign the class "current" to the li element belonging to the actual page.

          There is also a parameter &hereClass. In comparison to &selfClass, the value of &hereClass would be assigned not only to the the li element of the actual item, but also to the ones of its parent, grandparent and so on up the tree (that is to all the items which would appear in a breadcrumbs line).

          Edit: Clarified that it's the li element to get the class. [ed. note: ottogal last edited this post 9 years, 6 months ago.]