Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-05-05 17:09:22

cmlowe
New Member
Registered: 2009-03-10
Posts: 3

Classing items based on their category

I want to generate an article list of all articles in a parent category, Projects. The catch is I want each <li> to get classed based on the cateogry they belong to. For instance there are 3 sub categories Art, Architecture and Object. The desired output is something like this:

<ul>
<li class=“art”>….</li>
<li class=“object”>…</li>
<li class=“object”>…</li>
<li class=“architecure”>…</li>

</ul>

Once I have this list generated with the appropriate classes I want to interact with it using Javascript…the problem is I can’t figure out how to generate this list with the classes dynamically.

Thank for the help

Last edited by cmlowe (2010-05-05 17:09:52)

Offline

#2 2010-05-05 17:13:36

cmlowe
New Member
Registered: 2009-03-10
Posts: 3

Re: Classing items based on their category

Nevermind, I just figured it out. I guess all it took was writing it out.

Offline

Board footer

Powered by FluxBB