Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
about HTTP status codes and txp:if_status
Hi!
First, the requested feature: on txp:if_status
, add support for multiples values on the status
attribute. Like this:
@<txp:if_status status=“404, 503”>… some magic… </txp:if_status>
For example, in a site, I’m sharing the header
form (a form that outputs mainly the <header>
of the site) across section templates, error_default
and error_503
templates.
So, I’m having to use this code, for example:
<txp:if_status status="404">
<txp:output_form form="nav" />
</txp:if_status>
<txp:if_status status="503">
<txp:output_form form="nav" />
</txp:if_status>
<txp:if_section name="">
<txp:else />
<txp:output_form form="nav" />
</txp:if_section>
If the requested feature is added, this could be written like this:
<txp:if_status status="404, 503">
<txp:output_form form="nav" />
</txp:if_status>
<txp:if_section name="">
<txp:else />
<txp:output_form form="nav" />
</txp:if_section>
——
Also, please, could someone share some information and some secret neat tricks regarding HTTP status codes and TXP, if any?
Offline
Re: about HTTP status codes and txp:if_status
not sure how this would be useful for most cases. if you already have error_default and error_503 pages then why bother with the if_status tag?
Offline
Re: about HTTP status codes and txp:if_status
not sure how this would be useful for most cases. if you already have error_default and error_503 pages then why bother with the if_status tag?
In example if you don’t want to write error-titles and head-sections again for different templates. In example:
<title><txp:if_status status="404">404 | Not found | </txp:if_status> Default title here, sitename, article title, category, tags - something we ever want</title>
I hate writing things again and again – therefor conditionals with multiple options are good. But I don’t know if txp:if_status
(it won’t, heh) requires multiple values ‘cause the message would be different in both cases :)
Last edited by Gocom (2008-06-27 09:55:35)
Offline