Hi all,
I’m having a slight problem with a secondary wayfinder menu using css classes and am hoping someone can help shed some light on the situation.
Brief Background:
On my site i have 2 menus:
1) Primary Navigation
2) Secondary Sub Navigation for the inner pages.
The primary menu is working as it should and uses the standard wayfindID call. For the secondary menu, i have created an unpublished resource and within this resource i have created numerous weblinks which point to the desired sub-nav resources. In my template, i then placed another call to wayfinder in the desired location for the sub nav and used the parent resource ID as the start ID of the call. This basically will then display all the weblink titles in my secondary nav.
Problem:
The functionality works correctly but i am having an issue with the css classes of the unordered list.
Basically i am trying to output the following code:
<ul class="submenu">
<li><a href="#">link1</a></li>
<li><a href="#">link2</a></li>
<li><a href="#">link3</a></li>
<li><a href="#">link4</a></li>
<li><a href="#">link5</a></li>
<li class="last"></li>
</ul>
I have tried various ways to achieve this but cant get the desired output. At the moment wayfinder adds the class="last" to Link5 therefore causing issues to my design. I’m also not sure how to set the <UL> class either.
Currently my template uses this code:
<ul class="submenu">
[!Wayfinder?startId=`ID`!]
</ul>
but outputs this:
<ul class="submenu">
<ul><li><a href="#" title="link 1" >Link 1</a></li>
<li><a href="#" title="Link 2" >Link 2</a></li>
<li><a href="#" title="Link 3" >Link 3</a></li>
<li><a href="#" title="Link 4" >Link 4</a></li>
<li class="last"><a href="#" title="Link 5" >Link 5</a></li>
</ul>
</ul>
Any one have any suggestions on how i can achieve my desired output.
Would be greatly appreciated.
Thanks,
Ollie
-
☆ A M B ☆
- 3,112 Posts
1st, welcome to MODx.
You need to learn how to use [*variable*] and [+placeholder+] inside template, from
MODx tutorials.
<ul class="submenu">
[!Wayfinder?startId=`[*id*]`!]
</ul>
You can start learn about Wayfinder from
Kongondo’s Guide about Wayfinder.
You can jump over to trial and error on your self by learning stuffs from
Wayfinder author’s website, or
Cheatsheet.
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.