Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-01-26 06:51:27

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

How do I sanitise title tag to output "CGI friendly code"?

I’m building an Add to Google Calendar link on certain pages. Easy, except when the article title has an ampersand. Textpattern neatly encodes it as & but this is a “special character” for CGI parameter values, and Google recommends the CGI friendly alternative i.e. %26

Is there a plugin or other way to force the title tag to output “CGI friendly code” ?

Last edited by nardo (2010-01-26 06:51:57)

Offline

#2 2010-01-26 07:25:28

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

Re: How do I sanitise title tag to output "CGI friendly code"?

With rah_replace:

<txp:rah_replace from="&amp;" to="%26">
	My code with &amp;
</txp:rah_replace>

Offline

#3 2010-01-26 07:33:13

nardo
Member
From: tuvalahiti
Registered: 2004-04-22
Posts: 743

Re: How do I sanitise title tag to output "CGI friendly code"?

sweet as

thanks Jukka

Offline

Board footer

Powered by FluxBB