Content last modified Monday 6 March 2017
hop to #bottom
Current version:
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!


a plugin that lets you condition parts of the page depending on GET variables transferred with the url.

the plugin has three functions. the first of which, chs_if_urlvar, lets you condition that if GET variable designsated is equal to the value designated, the enclosed text will appear (an example is in the documentation).

another one, chs_urlvar_default, will show the enclosed text only if the variable is not declared in the url, and a third one, chs_urlvar_exists, will show the enclosed text only if the variable is declared.

more info about usage is in the docs.

Article Request Count:
Initially released:
October 1st, 2005
Posted here:
01 Oct 2005

Comments/questions? Leave a message in the form.

Commenting is closed for this article.

Commented (10)

I am definitely going to test this and report, it could open lots of possibilities for me ! Thx !
good example at this forum thread:
I did write an article about the plugin in german. Read it -> here.
can this also output clean URLs?
Is there support for this plugin? I noticed that if you use var=”c” the condition is seen as true if the url is /?c=name-of-category, but also if the url is /category/name-of-category.
Really? Strange. It probably means that Textpattern sets $_GET[‘c’] before the plugin code is executed. Nice to know, though.
What a great relief to have this Textpattern plugin. I try to avoid embedding PHP in my page templates and Textpattern forms as much as possibly, so chs_if_url_var makes a nice building block to enforce that principle.


This plugin seems to work in Textpattern’s versions 4.0.7 and 4.0.8 without problems. If someone needs this, I’m hosting this file over here.


this plugin opens you up to cross-site vulnerabilities.. specifically:

<txp:chs_urlvar_echo var=“foo”>


Noam Samuel:

OK, this is a fixed version (raw text right now):

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

Would you care to write a comment?

You know you want to visit the Archives.




There are also tag clouds, 'cause those are fun.
Published with Textpattern