Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2008-02-29 21:20:19
- jim_01
- Member
- Registered: 2008-01-17
- Posts: 35
cbs_navigation_menu, class="active"
Hi I have the cbs_navigation_menu plugin for my primary nav. It works great and sets any main navigation item that is clicked on as class=“active”. However if I click on an article for that section the class=“active” flag is lost. Does anyone have any ideas?
Thanks!
Offline
Re: cbs_navigation_menu, class="active"
Just a guess, but I had a similar issue with cbs_category_list, and both plugins use the same core function. I described my problem and solution on the cbs_category_list thread.
Code is topiary
Offline
#3 2008-03-01 14:36:14
- jim_01
- Member
- Registered: 2008-01-17
- Posts: 35
Re: cbs_navigation_menu, class="active"
Thanks. I checked it out but it doesn’t work.
Are there any similar plugins that create a navigation and can assign an active class tag?
Offline
Re: cbs_navigation_menu, class="active"
You don’t really need to use a plugin for your main navigation. Using section_list tag, you have an attribute for active class.
Offline
#5 2008-03-01 15:06:21
- jim_01
- Member
- Registered: 2008-01-17
- Posts: 35
Re: cbs_navigation_menu, class="active"
But that doesn’t allow you to add a unique ID for each link.
However I have just realised that the pluging does work, the issue was that I have the a “news” section as my default page and as a link. So in order to allow the plugin to understand that I want news as a link and as my default I needed to add
sections=“default,news,…
titles=“news,news,…
In essence duplicating it. Anyway, hope this helps someone else!
Offline
Re: cbs_navigation_menu, class="active"
Not sure what you want, but I have something like this on one site, which is a simple and effective way to build a menu system:
<ul id="menu">
<li><a <txp:if_section name="">class="active" </txp:if_section>href="<txp:site_url />">Home</a></li>
<li><a <txp:if_section name="news">class="active" </txp:if_section>href="<txp:site_url />news/">News</a></li>
</ul>
Offline
#7 2008-03-02 23:08:13
- jim_01
- Member
- Registered: 2008-01-17
- Posts: 35
Re: cbs_navigation_menu, class="active"
Hi,
Thanks thats pretty cool. I tried it and it works brilliantly. You can even stipulate multiple sections eg: <txp:if_section name=“news, default”>
Thanks!!!
Offline
Pages: 1