Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-17 12:45:35

shorebreak
New Member
Registered: 2006-12-30
Posts: 4

if_category with empty category name

i want to have a
<txp:if_category name=”“>

</txp:if_category>

to match the default category name which is empty.
but it doesn’t work.
how can i match the default category?

Offline

#2 2007-01-17 15:57:14

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: if_category with empty category name

<txp:if_category> “When the name attribute is not specified, if_category will test whether or not the user is viewing any category.”

…from Textpattern.net

Last edited by mrdale (2007-01-17 15:58:13)

Offline

#3 2007-01-17 17:53:41

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: if_category with empty category name

What do you mean exactly with ‘default category’? What is it that you want to achieve with those tags?

Offline

#4 2007-01-17 20:50:47

shorebreak
New Member
Registered: 2006-12-30
Posts: 4

Re: if_category with empty category name

i have a menu which is a pain to create in textpattern if i may say so. which shows the 5 main categories along with a link to the homepage. i also have a submenu which shows the subcategories of the current main category. but if i’m on the homepage and thus no category is selected the submenu shows the same list of categories as the main menu but i want it to show the subcategories of one of the main categories instead.

bq.<txp:if_category> “When the name attribute is not specified, if_category will test whether or not the user is viewing any category.”

<txp:if_category> do this
</txp:if_category>

will do this be done if a category is active or if there is none?

can i nest if tags??

Offline

#5 2007-01-17 23:11:11

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: if_category with empty category name

<txp:if_category>
here your code for when a (any) category page is being viewed
<txp:else />
here your code for the home page
</txp:if_category>

Offline

Board footer

Powered by FluxBB