Content last modified Tuesday 24 August 2021
hop to #bottom
Categories:
Author:
Current version:
0.4
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!

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

Article Request Count:
Initially released:
2004-05-27
Posted here:
22 Feb 2005

You know you want to visit the Archives.
Published with Textpattern