Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2009-02-21 13:26:34
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Complete link list separated by category names formatted as headers
Hi,
I have a site that wil eventually have a lot of links sorted into categories and the user should be able to add new categories and links.
On one page I want to automatically generate a complete list of all links separated by their categories formatted as headers like so:
<h3>Category One</h3>
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</u>
<h3>Category Two</h3>
<ul>
<li>Link 1</li>
<li>Link 2</li>
<li>Link 3</li>
</u>
etc. etc.
How do I get Textpattern to loop through all link categories and output the contained links?
It looks like a job for <txp:if_different>
, but I don’t understand it well enough to use it.
Any ideas?
Cheers Martin
Last edited by masa (2009-02-21 13:27:34)
Offline
Re: Complete link list separated by category names formatted as headers
This how to should be of help:)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Complete link list separated by category names formatted as headers
Or this more recent thread with an if_different suggestion from Els.
TXP Builders – finely-crafted code, design and txp
Offline
#4 2009-02-21 14:32:32
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: Complete link list separated by category names formatted as headers
Thanks, Yiannis and Jakob,
that was embarrassingly easy.
I had never used <txp:category_list>
much and was trying to build something with the wrong tags for the job. :-)
Last edited by masa (2009-02-21 14:34:07)
Offline