Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-11-18 14:42:01

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

if_article_category behaviour

Hi all

I just noticed today that <txp:if_article_category name=”,thecat”> didnt find article without category set, i have supposed it works like txp:if_category but it seems not.

Is it possible to have the same behaviour regarding putting name=”“ or name=”,onecat” ?

Thanks

Offline

#2 2011-11-18 15:23:29

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: if_article_category behaviour

Hi Rabah

What if you use <txp:if_article_category name='<txp:category />'>?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2011-11-18 15:56:29

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: if_article_category behaviour

Hi Yiannis

I try to achieve that <txp;if_article_category name=”, thecat”> will be true if the article have a cetgory named thecat or havent a categroy set at all.
Now it only give me a category named thecat and not the others.

the tag is not working like txp:category.

I dont understund how your code work, the context for my code is in individual article, then <txp:category /> should return nothing in that case.

Offline

#4 2011-11-18 18:34:49

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

Re: if_article_category behaviour

Does this work?

<txp:if_article_category>
   <txp:if_article_category name="thecat">
      category = 'thecat' -> do something
   <txp:else />
      category = any category but 'thecat' -> do nothing
   </txp:if_article_category>
<txp:else />
   no category set -> do something
</txp:if_article_category>

Last edited by els (2011-11-18 18:36:20)

Offline

#5 2011-11-18 22:08:08

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: if_article_category behaviour

Hi Els

Thanks for the code Els, i now that solution that i use in that case, but that need an extra code, what i say is why txp:if_article_category does’nt have the same behaviour as txp:category in this case! it could be useful and consistant.

Cheers

Offline

Board footer

Powered by FluxBB