Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-06-27 05:05:27

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#2 2008-06-27 09:15:45

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

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

#3 2008-06-27 09:55:04

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

Board footer

Powered by FluxBB