Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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?
Offline
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
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.
Offline
Offline