Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Create a navigation list
Hi everyone,
this is the question: I want to create a menu where categories with more than one article groups their articles in nest unordered list, while categories with only one article are directly rendered as list item of primary list.
How can I tell Textpattern to check the numbers of article per categories and let it write the right HTML?
Something like:
<ul> <li><a class="have-more-than-one-articles">Article category</a> <ul> <li><a href="#">Article title</a></li> <li><a href="#">Article title</a></li> <li><a href="#">Article title</a></li> </ul> </li> <li><a class="only-one-article" hre="#">Article title</li> <li><a class="only-one-article" hre="#">Article title</li> <li><a class="only-one-article" hre="#">Article title</li> </ul>
Thanks
Last edited by wornout (2010-11-23 14:49:11)
Offline
#2 2010-11-23 18:01:59
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Create a navigation list
You can do that using this method, the example code is for sections and a slightly different context, but you should be able to adapt it to your needs.
If you need help let me know :)
Offline
Re: Create a navigation list
I think I can do that!
Thanks for all support Els :-)
Offline
Pages: 1