Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.31
About It:
Get it:
Rate it:
  • Helpful?
  • 2 Yes
  • 0 No
Flag it:
Contact Reason [ ? ]

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
Article modified:
26 Mar 2008

If there is a comment form at the Information URL, you may want to leave your comments/questions there or at the Forum thread for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (2)

This is a really useful plugin for me.
gmb:

Download file is broken. Too bad because I can’t find this plug-in anywhere else.

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

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