Content last modified Wednesday 6 August 2008
hop to #bottom
Categories:
Author:
Current version:
0.5
About It:
Get it:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:
Contact Reason [ ? ]

chs_if_urlvar

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.

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (7)

I am definitely going to test this and report, it could open lots of possibilities for me ! Thx !
nardo:
good example at this forum thread:
http://forum.textpattern.com/viewtopic.php?pid=81059
I did write an article about the plugin in german. Read it -> here.
drew:
can this also output clean URLs?
Els:
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.

Thanks!

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

Would you care to write a comment?

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
TxP · TxD · GG