Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-05-08 06:44:57

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

txp:if_category?

<txp:if_category name="About">
<div id="menuin2">
<txp:else />
<div id="menuin">
</txp:if_category>

Should that code output <div id=“menuin2”> if the category is “About” and <div id=“menuin”> if it is not?

It doesn’t :( it just outputs <div id=“menuin”> whatever the category.

Help

Offline

#2 2008-05-08 07:08:17

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: txp:if_category?

try lowercasing the category name

Offline

#3 2008-05-08 07:29:56

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: txp:if_category?

ha ha – cool – that’s fixed all my problems :)

Thats wierd – when I was making the site using a url like http://23.45.85.2/~name/index.php – everything worked, yet as soon as the domain propagated – the conditional categories stopped working.

Also my actual category names are About, Contact etc – but in the wiki it says “Attributes – Tag will accept the following attributes (case-sensitive)”

So I wonder why Ruud’s suggestion worked?

Offline

#4 2008-05-08 07:36:58

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: txp:if_category?

I’m not complaining BTW – thanks Ruud :)

Offline

#5 2008-05-08 15:56:57

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: txp:if_category?

Using capitals for things that may appear in the URL, such as categories or sections (just the “name” not the “title”), can cause problems. It’s not a TXP thing just a general problem that can be a PITA.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#6 2008-05-08 20:53:06

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: txp:if_category?

Thanks Stuart – at least I know for the future

Offline

Board footer

Powered by FluxBB