Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
how do I detect I am on a child category...?
How can I detect if I am on a category page which has a particular parent category?
this is what I am trying to achieve: <txp:if_category parent="some_parent_cat">show something<txp:else />show something else</txp:if_category>
I know that the parent
attribute is not supported in the if_category
tag but included it above as it clearly explains where I am lost. I am looking at smd_parent but I am wondering if it can be done using native tags.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: how do I detect I am on a child category...?
Hi colak! Something like this?
<txp:category_list parent="some_parent_cat">
<txp:if_category name='<txp:category />'>
<txp:variable name="done" value="1" />
</txp:if_category>
</txp:category_list>
<txp:if_variable name="done" value="1">
show something
<txp:else />
show something else
</txp:if_variable>
Offline
Re: how do I detect I am on a child category...?
Hey Oleg
This looks like it might work. Thanks!
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline