Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-09-13 06:50:25

dazonic
Member
Registered: 2006-10-24
Posts: 43

Section list items with different classes

Hi, i want use css image replacement in my section list, but also keep activeclass.

so i want to output this:

<ul>
<li><a class="home active" href="http://project.dazonic.net/">Home</a></li>
<li><a class="events" href="http://project.dazonic.net/events/">Events</a></li>
<li><a class="gallery" href="http://project.dazonic.net/gallery/">Gallery</a></li>
</ul>

i’m guessing it’ll involve a plugin? if someone could point me in the right direction that’d be great.
thanks!

Last edited by dazonic (2007-09-13 07:13:27)

Offline

#2 2007-09-13 08:30:34

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Section list items with different classes

txp:if_section

IE.

<li><a class="events<txp:if_section name="events"> active</txp:if_section>" href="<txp:site_url />events/">Events</a></li>

Cheers!

Last edited by Gocom (2007-09-13 08:32:09)

Offline

#3 2007-09-13 09:38:58

dazonic
Member
Registered: 2006-10-24
Posts: 43

Re: Section list items with different classes

right on.

thanks heaps mate.

Offline

#4 2007-09-13 15:16:39

the_ghost
Plugin Author
From: Minsk, The Republic of Belarus
Registered: 2007-07-26
Posts: 907
Website

Re: Section list items with different classes

There are plugins that have such option – to add special style to currently active section


Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?

Offline

#5 2007-09-14 02:07:36

dazonic
Member
Registered: 2006-10-24
Posts: 43

Re: Section list items with different classes

active_class will do it, no need for plugins.

the problem was, i need a separate class for each item (for css image replacement) as well as a class when that section is active.

i thought there may have been a plugin that i could do something like…

<txp:xxx_badass_section_list wraptag="ul" break="li" section_as_class="1" active_class="active" />

Offline

Board footer

Powered by FluxBB