Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2006-11-01 16:03:48

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?

Okay, I’m looking at the source again, and it looks like, for whatever reason, this tag was overlooked for the multiple category names feature. >x Now I’m trying to get it to do so…

Offline

#14 2006-11-01 16:13:32

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?

mary, this is just GREAT! thanx a zillion!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#15 2006-11-01 16:39:54

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?

I’ve never been able to get if_article_category to take a list for the name attribute. I tried rewriting it to do so and ran in to so many headaches that I settled for two tags, one for each category level, and then nested them.

Plugin ras_if_article_category

Usage Example

It would be nice to get it working with one tag.

Offline

#16 2006-11-01 16:57:48

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?

rick,

on another note: what would you do, if you want to select only articles, which do not have a category assigned in either or both categories?

edit: <txp:if_article_category name=”“> ???
this should work
<txp:if_article_category name=“all,the,categories,i,have”>
<txp:else />
…the (non-) categories left…
</txp:if_article_category>

given the multiple categories in the tag work soon.

Last edited by jayrope (2006-11-01 17:16:04)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#17 2006-11-02 03:47:28

rsilletti
Moderator
From: Spokane WA
Registered: 2004-04-28
Posts: 707

Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?

The else clause will work fine for categories not in the list, however, that by itself doesn’t prove an empty category. An empty category assigned as a attribute probably won’t test for an empty category either, the tag as it is written simply tunes it out. I’d write a plugin to test specifically for an empty category.

Offline

#18 2006-11-02 17:12:48

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

Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?

Wouldn’t this work?

<txp:if_article_category>
<txp:else />
blah
</txp:if_article_category>

I haven’t tried it, but it works for <txp:if_category>.

Offline

#19 2006-11-02 20:15:36

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?

The example Els posted should work.

Offline

Board footer

Powered by FluxBB