Content last modified Monday 6 March 2017
hop to #bottom
Current version:
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!


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:

            <li>will always display</li>
        <txp:mdm_if_category category="">
            <li>displays only if no category selected</li>
        <txp:mdm_if_category category="Mass Transit">
            <li>displays only if Mass Transit category selected</li>
        <txp:mdm_if_category category="vx">
            <li>displays only if vx category selected</li>

this plugin has since been adopted and can be found at gho_if_category

Article Request Count:
Initially released:
Posted here:
21 Feb 2005
Article modified:
02 Nov 2006

You may want to leave your comments/questions at the Forum thread for quicker feedback. Otherwise, comment away:

Commenting is closed for this article.

Commented (4)

FYI, user graumeister ( is taking ownership of this plugin.
...this plugin link seems to be dead.
this plugin is obsolete since there is an internal version of if_category available. the old version of the plugin can be found here

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.

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern