I want to add a class ("navbar-right") in last Li. But wayfinder is adding the class in wrong place(in this case in "a" element)
Below is the output:
<ul class="nav navbar-nav">
<li class="dropdown"><a class="active" href="/about-us.html" title="About Us">About Us</a></li>
<li class="dropdown"><a href="/software-services.html" title="Services">Services</a></li>
<li class="dropdown"><a href="/products.html" title="Products">Products</a></li>
<li class="dropdown"><a href="/knowledge-center.html" title="Knowledge Center">Knowledge Center </a></li>
<li class="dropdown"><a class="navbar-right" href="/events1.html" title="Events">Events</a></li></ul>
This is how i'm calling wayfinder:
[[Wayfinder? &startId=`0` &parentRowTpl=`Firstlevel-NavItem` &outerTpl=`Outer-Nav` &innerTpl=`Firstlevel-Nav` &rowTpl=`Inner-Row` &excludeDocs=`1,136` &lastClass=`navbar-right` ]]
Above navigation is 2 level drop down and I want to add class in only first level's last element.
Thanks in advance! help needed urgently.
-
☆ A M B ☆
- 24,524 Posts
Then you need to look at your rowTpl. The rest of the rows will be handled by the innerRowTpl. Or, you can add a level to them all and work with level1.last
-
☆ A M B ☆
- 24,524 Posts
You need to have the [[+wf.classes]] placeholder in the li tag. Wayfinder automatically adds a "last" class to reach set of rows.
Since you want to have the 'dropdown' class in the li tags, you'll need to use this instead:
<li class="dropdown [[+wf.classnames]]"><a ...
-
☆ A M B ☆
- 24,524 Posts
As far as I know, Evo or Revo, wf.classes will put the whole attribute - class="classname", which you don't want, since you are already specifying class="dropdown". The wf.classnames will just add the classnames, not the whole attribute.
@Sottwell, at least the syntax was changed, wasnt aware of the classnames attribute though thank you.