Categories:
Author:
Current version:
0.4
About It:
Get it:
Rate it:
Flag it:
mdm_if_category
This plugin is used as such:
<txp:mdm_if_category category="..."> stuff goes here </txp:mdm_if_category>
The category attribute is optional. If missing, the stuff always shows.
If category is the empty string “", the stuff shows only if no category is current for the page.
If category is some other string, the stuff shows only if the current category name matches.
It’s simply a string based comparison, so it will probably break when true hierarchical categories are available; I’ll have to fix it then.
Here’s an example to give you a better idea of how it might work on a page:
<ul>
<txp:mdm_if_category>
<li>will always display</li>
</txp:mdm_if_category>
<txp:mdm_if_category category="">
<li>displays only if no category selected</li>
</txp:mdm_if_category>
<txp:mdm_if_category category="Mass Transit">
<li>displays only if Mass Transit category selected</li>
</txp:mdm_if_category>
<txp:mdm_if_category category="vx">
<li>displays only if vx category selected</li>
</txp:mdm_if_category>
</ul>
this plugin has since been adopted and can be found at gho_if_category
Initially released:
2004-05-27Posted here:
21 Feb 2005Article modified:
02 Nov 2006









You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:
Commented (4)
I don’t think it’s obsolete as the built-in functionality in TXP doesn’t have a negation option IMHO (especially not for “no category selected” = homepage). I find this plugin to be extremely useful.
Subscribe to this article's comments RSS feed. [ ? ] View Recent Comments across the site.