Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-05-18 19:06:24

ultramega
Member
Registered: 2006-02-26
Posts: 221

How to list children categories of a parent with txp:if_category?

I need two separate kind of layout for category listing.

Problem: The tag “txp:if_category name=“cat1,cat2,cat3” requires that someone keeps the list up to date in code when writers add categories. I’d like to have it automatic to be sure everything works as intended.

So if I have categories

parent: animals
childrens: fox, lion, bird

and

parent: humans
childrens: steve, bloke, mary

I’d like to have:

txp:if_category name=“animals”
layout 1, suitable for animals
lists articles under selected animal category

txp:if_category name=“humans”
layout2, suitable for human beings,
lists articles under selected human category

Possible? Plugins? Variables? Please advice :)

Offline

#2 2009-05-18 19:18:19

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: How to list children categories of a parent with txp:if_category?

hi ultramega,

not sure if I understood your request, but could this txp tip be helpful?

Sorry to disagree, but:

parent: humans
childrens: steve, bloke, mary

That guy is not human, have you seen his plugins? have you seen his forum posts? No human can write that much…


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2009-05-18 20:32:22

ultramega
Member
Registered: 2006-02-26
Posts: 221

Re: How to list children categories of a parent with txp:if_category?

Well, I was not exactly sure how to categorize him, so to be on safe side I choosed humans.

And to prove your words… it seems Bloke has plugin even for this, hah :)

<txp:smd_if field=“parent” operator=“contains” value=“humans”>
Layout for human-parent category

and so on…

Thanks anyway!

Offline

Board footer

Powered by FluxBB