Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-14 15:58:22

leafy_loader
Member
Registered: 2008-09-25
Posts: 96

Showing the current active link in the navigation

I have created a list of navigation links made up from article titles, so when the user clicks on the link the relevant article is displayed. I want to apply a class to the link clicked to change the colour of the link as an indication as to which link is active. This is the code I’m using to do so in my form but it doesn’t work. I’m still grasping the basics of textpattern so forgive my ignorance;

<li><a href=”<txp:permlink />”<txp:if_article_id id=<txp:article_id />> class=“current”</txp:if_article_id> title=”<txp:title />”><txp:title /></a></li>

Offline

#2 2008-10-14 16:13:43

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Showing the current active link in the navigation

You can’t use tags within tags unless you’re using the development version of Textpattern There is a plugin that allows you to do this called asy_wondertag


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#3 2008-10-14 16:17:52

leafy_loader
Member
Registered: 2008-09-25
Posts: 96

Re: Showing the current active link in the navigation

I’ve seen this plugin you mention Matt but before I install it I wanted to know if there was a way to do it with the standard issue of textpattern

Offline

#4 2008-10-14 17:42:42

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Showing the current active link in the navigation

There is a plugin that can do it, but personally I’d prefer asy_wondertag. You can get rid of it as soon as 4.0.7 is released.

Offline

#5 2008-10-14 18:00:47

leafy_loader
Member
Registered: 2008-09-25
Posts: 96

Re: Showing the current active link in the navigation

Thanks guys. So can I assume it can’t be done without a plugin? I just want to make sure I understand textpattern to the fullest

Offline

#6 2008-10-14 18:46:04

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Showing the current active link in the navigation

What you tried to do will be possible in the next release, 4.0.7 :)

Offline

#7 2008-10-14 20:07:16

leafy_loader
Member
Registered: 2008-09-25
Posts: 96

Re: Showing the current active link in the navigation

http://textpattern.org/tutorials/899/dynamic-sub-menu-with-active-class this plugin works perfectly for me

Offline

Board footer

Powered by FluxBB