Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-10-26 13:45:20

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Excluding children categories from category_list

I’m full of questions today!
I’m using: <txp:category_list exclude=“Collections”/>

but that still shows me subcategories of “Collections”

is there a way of avoiding it, without having to specify each child category? I’d like the client to be able to manage categories and not have to upldate templates after each addition.


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

#2 2008-10-26 14:27:23

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Excluding children categories from category_list

If you render your category list as nested lists you could simply hide all child categories with a css rule like…

ul li ul { display: none }

Offline

#3 2008-10-26 14:59:16

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Excluding children categories from category_list

I’d be surprised if smd_query wouldn’t be able to do that :)

Offline

#4 2008-10-26 15:47:58

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: Excluding children categories from category_list

maybe stw_category_tree can help!

Hum i think it’s not matching your need!

maybe cbs_category_list then, i haven’t tested!

Cheers

Last edited by Dragondz (2008-10-26 15:52:50)

Offline

#5 2008-10-26 16:05:31

masa
Member
From: Asturias, Spain
Registered: 2005-11-25
Posts: 1,091

Re: Excluding children categories from category_list

Dragondz wrote:

maybe cbs_category_list then, i haven’t tested!

That should work. If your category structure looked like this:

globalcat
– cat 1
– – subcat 1
– – subcat 2
– – subcat 3
– cat 2
– – subcat 4
– – subcat 5
– – subcat 6

etc.

…you should be able to use <txp:cbs_category_list parent="globalcat" /> since it will only display direct children of a given parent but not grand children.

Offline

#6 2008-10-26 17:27:25

kemie
Plugin Author
From: mexico<-->sweden
Registered: 2004-05-20
Posts: 495
Website

Re: Excluding children categories from category_list

I knew there had to be a plugin that did that! :)
thank you!


~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~

Offline

Board footer

Powered by FluxBB