Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-12-04 17:18:34

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Category list tag

I am outputting a list of categories in a section I have called “software”.

In the default page (I only use one page with conditionals) I have:

<code>
<div id=“rightcontent”>
<ul>
<li><txp:link_to_home>Hjem</txp:link_to_home></li>
<txp:section wraptag=“li” link=1 title=1 name=“kameleon” />
<txp:section wraptag=“li” link=1 title=1 name=“software” />
<txp:if_section name=“software”>
<ul class=“subcat”>
<txp:category wraptag=“li” link=1 title=1 name=“PG-server” />
<txp:category wraptag=“li” link=1 title=1 name=“Klienter” />
<txp:category wraptag=“li” link=1 title=1 name=“API-Grensesnitt” />
<txp:category wraptag=“li” link=1 title=1 name=“Grunnregister” />
<txp:category wraptag=“li” link=1 title=1 name=“Ordre” />
<txp:category wraptag=“li” link=1 title=1 name=“Produksjon” />
<txp:category wraptag=“li” link=1 title=1 name=“Lager” />
<txp:category wraptag=“li” link=1 title=1 name=“Utekspedering” />
</ul>
<txp:category_list wraptag=“ul” break=“li” />
</txp:if_section>
<txp:section wraptag=“li” link=1 title=1 name=“hardware” />
<txp:section wraptag=“li” link=1 title=1 name=“systemlosninger” />
<txp:section wraptag=“li” link=1 title=1 name=“pressemeldinger” />
<txp:section wraptag=“li” link=1 title=1 name=“linker” />
<txp:section wraptag=“li” link=1 title=1 name=“kontakt” />
</ul>
</div>
</code>

The important part is here:
<code>
<txp:if_section name=“software”>
<ul class=“subcat”>
<txp:category wraptag=“li” link=1 title=1 name=“PG-server” />
<txp:category wraptag=“li” link=1 title=1 name=“Klienter” />
<txp:category wraptag=“li” link=1 title=1 name=“API-Grensesnitt” />
<txp:category wraptag=“li” link=1 title=1 name=“Grunnregister” />
<txp:category wraptag=“li” link=1 title=1 name=“Ordre” />
<txp:category wraptag=“li” link=1 title=1 name=“Produksjon” />
<txp:category wraptag=“li” link=1 title=1 name=“Lager” />
<txp:category wraptag=“li” link=1 title=1 name=“Utekspedering” />
</ul>
<txp:category_list wraptag=“ul” break=“li” />
</txp:if_section>
</code>

With the txp:category tags all works well, I get the articles associated with the category. With the txp:category_list tag (which outputs all the categories in the sidebar correctly) NO article is displayed.

Wondering why….!!

Offline

#2 2005-12-05 15:32:09

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Category list tag

On a related note, how does one go about styling something like this:

txp:category wraptag=“li” link=1 title=1 name=“PG-server”

I know I can add a class to the UL tag, but how to do it with the LI tag?

Basically, what I want is to have an active state so the user knows where he/she is.

Hope I said it clearly ;-)

Offline

Board footer

Powered by FluxBB