rah_if_search
Published under current TXP projects
Extends search conditional with a new name-attribute.
Image: rah_if_search
Intro and description
The plugin, rah_if_search, extends the core <txp:if_search>-function with a name-attribute. The new name-attribute is searchcriteria relative, and outputs wrapped content only if the search term is same than the value. Alternatively, if the name-attribute is left empty, the plugin and tag, works the same way as the normal inbuild <txp:if_search>.
List of features
- Matches
name-attribute with given search criteria. - Supports
<txp:else />and also can be used the same way as inbuild<txp:if_search>.
Requirements
- Textpattern 4.x.x
Installation and usage
The general behavior stands: paste plugin code to the plugin installer textarea and run the automatic setup. Then just activate the plugin and you are ready to use new tags that plugin includes like others.
Attributes
The tag is, a container tag, <txp:rah_if_search> and attributes for it follow.
name
A search term that will output the surrounded content.
Default: name="" Example: "dog"
Example
<txp:rah_if_search name="dog">
You entered search term "dog".
<txp:else />
You looked something else.
</txp:rah_if_search>
Changelog
Version 0.3
- Added support of
<txp:else />. - Improved code.
- Better documention.
Version 0.2
- Added functionality of the core
if_search.
Version 0.1
- Initial release.