Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-08-25 18:19:07

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

multiple values for parent attribute in txp:category_list

Having this category tree, I’d like to traverse both mammal and reptile (and exclude them) with one call to txp:category_list

  • mammal
    • tiger
    • lion
    • human
    • zebra
  • reptile
    • crocodile
    • alligator

If parent attribute could accept multiple values, I think I could do this:

<txp:category_list parent="mammal, reptile" exclude="mammal, reptile" />

and get done with it

But currently, the parent attribute on txp:category_list accepts only one value.
So, current options are to use two calls to txp:category_list (one for mammal, one for reptile), or maybe assign them to a higher category (ie. animals) and use it as the value for parent attribute. But I’m not sure this second alternative would let me traverse mammal and reptile while at the same time excluding/filter them…

Bottom line: does it makes sense for parent attribute to accept multiple values?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#2 2012-08-25 20:12:18

joebaich
Member
From: DC Metro Area and elsewhere
Registered: 2006-09-24
Posts: 507
Website

Re: multiple values for parent attribute in txp:category_list

I think I used some thing similar to <txp:category_list parent="animal" exclude="animal,mammal, reptile" /> in the past. Away from base otherwise I would check it.

Last edited by joebaich (2012-08-25 20:12:34)

Offline

#3 2012-08-25 21:19:11

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

Re: multiple values for parent attribute in txp:category_list

Joe, thanks. Will try it.
Although having to re-group categories into a up-level category to be able to do so may not be always possible. Also, it won’t be possible for top-level categories, if there is more than one.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2012-10-17 17:37:24

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: multiple values for parent attribute in txp:category_list

Try r4358.

Offline

Board footer

Powered by FluxBB