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

    I need a little help with the wayfinder snippet - I’m having difficulties to assign a css class to the currently clicked document when using a nested list; as you can see below, when I click on a link in a sublist, the current clicked link as well as its parent get a class ’active’ assigned making it difficult to style just the clicked list item.

    am I doing something wrong - thank you in advance for your help.

    <div id="sideNav">
      <ul>
        <li><a href="#" title="Link" >Link</a>
          <ul>
            <li><a href="#" title="Link" >Link</a></li>
            <li class="last"><a href="#" title="Link" >Link</a></li>
          </ul>
        </li>
        <li><a href="#" title="Link" >Link</a></li>
        <li><a href="#" title="Link" >Link</a></li>
        <li class="[b]active[/b]"><a href="#" title="parent of clicked Link" >parent of clicked Link</a>
          <ul>
            <li class="[b]active[/b]"><a href="#" title="Link" >clicked Link</a></li>
            <li><a href="#" title="Link" >Link</a></li>
            <li><a href="#" title="Link" >Link</a></li>
            <li class="last"><a href="#" title="Link" >Link</a></li>
          </ul>
        </li>
        <li><a href="#" title="Link" >Link</a></li>
        <li><a href="#" title="Link" >Link</a></li>
        <li class="last"><a href="#" title="Link" >Link</a></li>
      </ul>
    </div>
    
      • 29076
      • 615 Posts
      What is your Wayfinder-call?
        I think, thererfor I am! But what I am, and why...?
        • 19889
        • 616 Posts
        [!Wayfinder? &startId=`0` &startId=`[[UltimateParent?&stepback=`1`]]`&outerTpl=`SideOuterTpl`&hereClass=`here`!]


        I think I also tried &selfClass with the same result
          • 15987
          • 786 Posts
          &selfClass will only apply the class to the current document and not its parents. Why is this not working for you?
            • 19889
            • 616 Posts
            I not sure yet but it looks that selfClass is kind of working - unfortunately, I couldn’t figure out yet if I could apply a class to the current link and not the li tag. I’m having difficulties to highlight just one item when I have click on a parent with a sublist and links since the definitions get inherited by the children.
              • 15987
              • 786 Posts
              if you want the class on the link and not the li, you will have to make a cuatom template. there is info in the documentation on how to do this.
                • 19889
                • 616 Posts
                can’t figure it out - this snippet is still kind of confusing to me.

                thanks for your help.

                maybe somebody can show me how those chunks have to look like.