Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-01-07 00:27:10
- Dan Hoy
- New Member
- Registered: 2006-12-29
- Posts: 5
styling links
HI,
I am pretty new to Textpattern and have some basic questions about styling navigation links.
I was wondering how to apply hooks to categories and nested categories so that if a person is on a certain page the links would be styled to indicate that.
For Example:
If I have three main Categories on a page- MUSIC, DANCING, PAINTING,
and the visitor has clicked “MUSIC” and then “blues”. I would like to style both of those links to show the visitor where they are within the site.
As indicated below:
>MUSIC
jazz
>blues
classical
DANCING
PAINTING
Any help would be greatly appreciated.
BTW: I do know how to style the top level category link with the
<txp:category_list active_class=“class name”/>
but that seems to only apply a hook to the parent level and when I click on the child of the parent- neither have a hook. I would like to apply a hook to both the parent and the child at the same time.
Thanks for your time.
Last edited by Dan Hoy (2007-01-07 00:30:06)
Offline
#2 2007-01-08 20:39:29
- Dan Hoy
- New Member
- Registered: 2006-12-29
- Posts: 5
Re: styling links
I found out how to do it, (for anybody else who would like to know a good method)
A designer who knows a great deal about TXP sent me an email with some instructions to style active links dynamically:
Quote: “I use a lot of conditional tags like this”:
<a href=”/journal/”<txp:if_section name=“journal”> class=“highlight”</txp:if_section>>Journal</a>
If you need to highlight individual articles, you can use the new (TXP 4.04) tag:
<txp:if_article_id id=“12”> class=“highlight”</txp:if_article_id>
Offline
#3 2007-02-05 09:51:07
- azw
- Member
- Registered: 2007-01-29
- Posts: 279
Re: styling links
Is there a way to determine if you are on the front page of a section?
I don’t want to have a link to the currently active page, but I’ve not found a way to write a conditional for that.
Offline
Pages: 1