Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-02-21 16:38:52
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
How can i exclude categories from a list
Hello,
I have five categories at the moment :
Default
Voorpagina
Zwangerschap
1e levensjaar
2e levensjaar
For a menu i wish to make a list of the categories except default and Voorpagina.
What i have at this moment is :
<ul id=“rgaccordmenu”>
<li>
<span class=“toggle”> <txp:if_different> <txp:category1 title=“1” /> </txp:if_different></span>
<ul class=“content”>
<li><txp:if_different> <txp:section title=“1” /></txp:if_different></li>
</ul>
</span>
</li>
How can i make this happen ?
Regards,
Roelof
Offline
Re: How can i exclude categories from a list
<txp:category_list exclude=",Voorpagina" />
Last edited by sthmtc (2008-02-21 17:20:26)
Offline
#3 2008-02-21 18:38:50
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
Hello,
Thank you for your tip, but default has not disappear from the list.
Regards,
Roelof
Offline
Re: How can i exclude categories from a list
do you have an actual category called “default”? if so, you simply have to exclude="Default,Voorpagina"
Last edited by sthmtc (2008-02-21 19:07:32)
Offline
#5 2008-02-21 19:13:54
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: How can i exclude categories from a list
Also what version of textpattern are you running?
As far as I recall the exclude attribute was only added in 4.0.4.
Offline
#6 2008-02-21 19:30:37
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
shtmyc,
I tried that and it doesn’t work.
Masa,
Im running 4.0.6.
Roelof
Offline
#7 2008-02-21 19:52:04
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How can i exclude categories from a list
Roelof, if you need the accordion menu, I don’t think category_list and/or section_list can be used.
If you want to exclude categories from your menu using if_different, you’ll have to wrap the code in your article form in if_article_category tags:
<txp:if_article_category name="default,voorpagina">
<txp:else />
your menu code here
</txp:if_article_category>
Last edited by els (2008-02-21 19:57:53)
Offline
#8 2008-02-21 20:13:16
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
Hello Els,
I don’t need especially the accordian menu , i might be another menu.
But it has to be the same way of working.
I have tried this :
<txp:if_article_category name=“default,voorpagina”>
<txp:else />
<ul id=“rgaccordmenu”>
<li>
<span class=“toggle”>
<txp:if_different>
<txp:category1 title=“1” />
</txp:if_different>
</span>
</li>
</txp:if_article_category>
But still default is seen on the page
Regards,
Roelof
Roelof
Last edited by roelof (2008-02-21 20:30:57)
Offline
Re: How can i exclude categories from a list
<txp:if_different>
isn’t going to do this as you need to exclude a couple of categories and that tag is going to extract all of them. I’m with Sven here, I think <txp:category_list />
has to be the best option short of trying one of the many plug-ins available.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#10 2008-02-21 21:26:51
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
oke,
What i really need is a list which looks like this :
Zwangerschap
Februari 2005
March 2005
……
Augustus 2005
1e levensjaar
September 2005
…
Augustus 2006
2e levensjaar
September 2006
…….
Augustus 2007
3e levensjaar
September 2007
…..
Augustus 2008
Where the months are the sections of the category zwangerschap, 1e levensjaar, 2e levensjaar, 3e levensjaar and so on.
Regards,
Roelof
Offline
#11 2008-02-21 21:29:11
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: How can i exclude categories from a list
Roelof
I am still assuming you want the menu structure to be like your current site, if I’m wrong please say so :)
If I’m right, I think you don’t even need categories ‘default’ and ‘voorpagina’. You also don’t need a section ‘default’, ‘default’ is just the front page, it’s not a real section.
Stuart
Would you mind giving your opinion on this? You are the archive/menu expert here :) Roelof now has this menu (not TXP). I thought it could be done like this. The months are categories, but it might be better to use posted?
EDIT: I had not read your last post, Roelof, but now I’m a bit confused… I’m not sure if your use of sections and categories is the best way to go.
Last edited by els (2008-02-21 21:31:41)
Offline
#12 2008-02-22 06:54:44
- roelof
- Member
- Registered: 2005-03-27
- Posts: 647
Re: How can i exclude categories from a list
Els,
Your right. Im trying to explain that but my englisch is not so good appearently.
Roelof
Offline