Content last modified Tuesday 24 August 2021
hop to #bottom
Categories:
Author:
Current version:
0.31
About It:
Get it:
Rate it:
  • Helpful?
  • 2 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!

swf_if_empty

It’s a simple function that checks to see if an entry field (title, body, excerpt, category1, category2 or image) contains data. If the if_not empty tag is used and the field contains data, the code between the open and close tags is executed, and if the field is empty the code is ignored. There is also an if_empty tag, which obviously does the opposite.

In version 3.0 there is also a minlength parameter so that you can specify how many words you require for the field not to be considered emtpy.

Currently the plugin works with the title, body, excerpt, category1, category2, and article_image fields.

If Empty does not work with keywords or custom fields.

For a plugin that works with custom fields, see mdn_if_custom .

Sample Code:
<txp:swf_if_empty field="title" minwords="2"> <p>Untitled</p> </txp:swf_if_empty>
or
<txp:swf_if_not_empty field="title" minwords="2"> <txp:title /> </txp:swf_if_not_empty>

Article Request Count:

Archived [?]: orphaned: broken links

Keywords/tags:
Initially released:
2004-06-26
Posted here:
16 Feb 2005

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