If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!
Lately, I’ve been writing Textpattern pages for relatively complex sites that do things like this:
<txp:if_section name="widgets,sprockets,thingies"> <txp:hide>The widgets, sprockets, and thingies sections have their own special layouts.</txp:hide> <txp:output_form form='content-<txp:section />' /> <txp:else /> <txp:hide>All the other sections look pretty much the same.</txp:hide> <txp:output_form form='content-default' /> </txp:if_section>
This plugin is designed to simplify this somewhat, and eliminate that list of section names (which is just one more thing for me to forget to update when I change the site).
A simple, hopefully self-explanatory conditional form:
<txp:atb_if_form name="someform"> <p>someform exists.</p> <txp:else /> <p>someform doesn't exist</p> </txp:atb_if_form>
Can be used exactly the same way as the built-in
output_form tag, except it doesn’t raise an error if the form provided doesn’t exist:
<txp:atb_output_form_if_exists form='foo-<txp:section />'> This text will be available via the txp:yield tag in foo-[section]. </txp:atb_output_form_if_exists>
It can also be used with a
<txp:atb_output_form_if_exists form='foo-<txp:section />'> This text will be available via the txp:yield tag in foo-[section]. <txp:else /> <txp:output_form form="foo-default" /> </txp:atb_output_form_if_exists>
You can also follow this on GitHub.