Content last modified Monday 3 September 2018
hop to #bottom
Categories:
Author:
Current version:
1.1
About It:
Get it:
Rate it:
  • Helpful?
  • 3 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!

mdn_if_custom

This plugin provides a number of conditional tests for custom fields. It will check for empty, notempty, equals, or notequals. It also includes an clause, so that the inverse of each test may have a false consequence as well.

example usage:

<txp:mdn_if_custom field="2" empty="1"> <else /> Author: <txp:rei_show_custom customid="2" /> </txp:mdn_if_custom>

…where if custom_field2 is empty, it will output nothing, and if custom_field2 is filled, it will print what is after the . In this case, since ‘Remillard’ was the etnry for custom_field2, it would print:

Author: Remillard

another example:

<txp:mdn_if_custom field="9" equal="author">by <txp:rei_show_custom customid="2" /> <else /> no author listed </txp:mdn_if_custom>

…where if custom_field9 is filled with the exact text “author”, then it will print
by <em>'name of author'</em>

but if custom_field9 is either empty OR filled with anything other than “author”, it will print

no author listed

Article Request Count:

Archived [?]: Built-in tag now exists: <a href="http://textpattern.net/wiki/index.php?title=Txp:if_custom_field">txp:if_custom_field</a>

Keywords/tags:
Initially released:
2004-11-23
Posted here:
23 Nov 2004

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