Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2005-12-16 23:03:26
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: in a section, choice of viewing articles by date or category
Alexandra, try out this example, it may help:
<p>Question: what is your favourite kind of dark carbonated beverage?</p>
<ul>
<li><a href="?soda=root-beer">A&W Root Beer</a></li>
<li><a href="?soda=coke">Coca-Cola</a></li>
<li><a href="?soda=pepsi">Pepsi</a></li>
</ul>
<txp:chs_urlvar_default var="soda">
<txp:chs_if_urlvar var="soda" value="root-beer">
<p>Your answer: A&W Root Beer Root Beer</p>
</txp:chs_if_urlvar>
<txp:chs_if_urlvar var="soda" value="coke">
<p>Your answer: Coca-Cola</p>
</txp:chs_if_urlvar>
<txp:chs_if_urlvar var="soda" value="pepsi">
<p>Your answer: Pepsi</p>
</txp:chs_if_urlvar>
</txp:chs_urlvar_default>
Edit: corrected code
Last edited by Mary (2006-02-26 18:13:02)
Offline
#14 2005-12-16 23:27:14
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: in a section, choice of viewing articles by date or category
Thanks sooo much mary!!! That is a great step forward. I checked your code locallly and it works perfect. I hope to figure out the rest on my own. Thx again.
btw. mary´s code example above is not quite correct.
Correct ist:
<code><txp:chs_if_urlvar var=“soda” value=“root-beer”>
<p>Your answer: A&W Root Beer Root Beer</p>
</txp:chs_if_urlvar> … </code>
Last edited by alexandra (2005-12-17 21:57:08)
Offline
#15 2006-03-23 23:10:33
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: in a section, choice of viewing articles by date or category
is it possible to use this plugin with messy urls?
on IIS and the plugin doesn’t work with the IIS clean URL hack…
Offline
Re: in a section, choice of viewing articles by date or category
Mary wrote:
<p>Question: what is your favourite kind of dark carbonated beverage?</p>
<ul>
<li><a href="?soda=root-beer">A&W Root Beer</a></li>
<li><a href="?soda=coke">Coca-Cola</a></li>
<li><a href="?soda=pepsi">Pepsi</a></li>
</ul>
<txp:chs_urlvar_default var="soda">
<txp:chs_if_urlvar var="soda" value="root-beer">
<p>Your answer: A&W Root Beer Root Beer</p>
</txp:chs_if_urlvar>
<txp:chs_if_urlvar var="soda" value="coke">
<p>Your answer: Coca-Cola</p>
</txp:chs_if_urlvar>
<txp:chs_if_urlvar var="soda" value="pepsi">
<p>Your answer: Pepsi</p>
</txp:chs_if_urlvar>
</txp:chs_urlvar_default>
Why this doesn’t work for me.
I always get this errors:
<code>
tag_error <txp:chs_urlvar_default var=“soda”> -> Notice: Undefined index: soda on line 8
tag_error <txp:chs_if_urlvar var=“soda” value=“root-beer”> -> Notice: Undefined index: soda on line 3
tag_error <txp:chs_if_urlvar var=“soda” value=“coke”> -> Notice: Undefined index: soda on line 3
tag_error <txp:chs_if_urlvar var=“soda” value=“pepsi”> -> Notice: Undefined index: soda on line 3
</code>
Offline
#17 2006-06-01 13:31:50
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: in a section, choice of viewing articles by date or category
You’ll need to talk to the plugin’s creator to fix it, but, if you change your production status from debugging Textpattern will hide those notices.
Offline
Re: in a section, choice of viewing articles by date or category
Yes I can hide the notices, but the real problem is that the plugin doesen’t work.
Offline
#19 2006-06-02 09:58:54
- noamsml
- New Member
- Registered: 2005-05-03
- Posts: 4
Re: in a section, choice of viewing articles by date or category
johnny_fx wrote:
<blockquote>
Mary wrote:
<p>Question: what is your favourite kind of dark carbonated beverage?</p>
<ul>
<li><a href="?soda=root-beer">A&W Root Beer</a></li>
<li><a href="?soda=coke">Coca-Cola</a></li>
<li><a href="?soda=pepsi">Pepsi</a></li>
</ul>
<txp:chs_urlvar_default var="soda">
<txp:chs_if_urlvar var="soda" value="root-beer">
<p>Your answer: A&W Root Beer Root Beer</p>
</txp:chs_if_urlvar>
<txp:chs_if_urlvar var="soda" value="coke">
<p>Your answer: Coca-Cola</p>
</txp:chs_if_urlvar>
<txp:chs_if_urlvar var="soda" value="pepsi">
<p>Your answer: Pepsi</p>
</txp:chs_if_urlvar>
</txp:chs_urlvar_default>
Why this doesn’t work for me.
I always get this errors:
<code>
tag_error <txp:chs_urlvar_default var=“soda”> -> Notice: Undefined index: soda on line 8
tag_error <txp:chs_if_urlvar var=“soda” value=“root-beer”> -> Notice: Undefined index: soda on line 3
tag_error <txp:chs_if_urlvar var=“soda” value=“coke”> -> Notice: Undefined index: soda on line 3
tag_error <txp:chs_if_urlvar var=“soda” value=“pepsi”> -> Notice: Undefined index: soda on line 3
</code>
</blockquote>
First of all, it shouldn’t work, since chs_urlvar_default will only activate if the variable is not passed to the page. Thus, if the chs_if_urlvar tags are reached, you know that the value of “soda” is null. If you change chs_urlvar_default to chs_urlvar_exists it will work.
As for the debug messages, they can be solved too. I’ll look into them when I’m slightly more awake.
Offline
Re: in a section, choice of viewing articles by date or category
intensify.org/movies is an awesome idea btw 8-)
A hole turned upside down is a dome, when there’s also gravity.
Offline