rah_if_gps
Published under current TXP projects
A tiny conditional plugin for Textpattern CMS. Used to match URI’s GET-values. Displays the contained block if the condition returns true.
Image: rah_if_gps
Intro and description
The plugin shows the wrapped block when the URL’s GET parameter’s value matches the condition.
Attributes
The tag is a container <txp:rah_if_gps>###</txp:rah_if_gps> and the attributes follow.
att
The GET parameter’s name.
Default: att="" Example: "foo"
val
The value of the GET parameter.
Default: val="" Example: "bar"
Example
<txp:rah_if_gps att="info" val="history">
Hello world!
<txp:else />
Something else.
</txp:rah_if_gps>
It outputs the “Hello world!” when browser’s url is set to http://example.com/?info=history and “Something else”, when not.
Changelog
Version 0.4
- Removed useless “if empty
val” check. Now thevalcan be empty, and the URL parameter’s can be checked against empty.
Version 0.3
- Added support for
<txp:else />.
Version 0.2
- Shortened code.
- Better documention.
Version 0.1
- Initial release.