Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Looking for a "if article's category =xx then" plugin
I was sure I saw that one, but I can’t find it.
I’m looking for a plugin to do a : if cat.1 or cat.2 of the current article = “xxx” then , that work with RC3.
I know the mdm_if_category plugin, but it test for the current category context, not the article’s one I believe.
Offline
#2 2005-04-22 18:21:02
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Looking for a "if article's category =xx then" plugin
Jeremie, I’m not sure if this will do what you are looking for, but some time ago I created (something that can hardly be called a) plugin, that outputs a form that is named exactly as the category. Read in this thread what it was meant to do and see for yourself if you can use it.
Offline
#3 2005-04-22 21:20:15
- davidm
- Member
- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: Looking for a "if article's category =xx then" plugin
Don’t remember if glx_if does it, I know there’s 12 different conditions with this one… quickest thing would be to check the conditional plugins on textpattern.org
Hope it helps !
.: Retired :.
Offline
#4 2005-04-22 22:07:39
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Looking for a "if article's category =xx then" plugin
No plugin required in RC3. Take a look at txp:if_category and txp:if_article_category.
Alex
Offline
#5 2005-04-23 00:06:07
- domfucssion
- Plugin Author
- Registered: 2004-10-23
- Posts: 39
Re: Looking for a "if article's category =xx then" plugin
zem: how do yo pass the category name you would be checking for to those tags?
Offline
Re: Looking for a "if article's category =xx then" plugin
> zem wrote:
> No plugin required in RC3. Take a look at txp:if_category and txp:if_article_category.
Take a look… where ? They are not in Textbook/
Ok, ok, I shut up :p Thx Zem
Offline
Re: Looking for a "if article's category =xx then" plugin
Ok I found them in an old changeset…
The syntax is name=”“ or number=”“ (I guess this is the category’s ID, don’t know how to find it easily in the backend).
I’ve tested the txp:if_article_category tag, it works fine (but only in an article form).
Offline
#8 2005-04-23 15:20:05
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: Looking for a "if article's category =xx then" plugin
> I’ve tested the txp:if_article_category tag, it works fine (but only in an article form).
Correct.
The ‘number’ parameter is used to limit the test to the Category1 or Category2 field only (i.e. <txp:if_article_category number="2" name="foo">
tests whether the Category2 field equals “foo”).
Alex
Offline
#9 2005-04-23 18:00:13
- davidm
- Member
- From: Paris, France
- Registered: 2004-04-27
- Posts: 719
Re: Looking for a "if article's category =xx then" plugin
Whaow that’s cool :) I sure can use that.
How did I miss that in the changeset… Thanks for the info !
.: Retired :.
Offline
#10 2005-05-08 22:10:30
- nytram
- New Member
- Registered: 2005-05-02
- Posts: 4
Re: Looking for a "if article's category =xx then" plugin
Suppose you have a page displaying only one article. Is it possible to do an if category on the page template that will determine the category of the displayed article? This is related to doing a multiple language website – see this topic. Thanks!
Offline
Re: Looking for a "if article's category =xx then" plugin
This is a great replacement for the mdm_if_category plugin, but doesn’t work with clean URLs – e.g “/downloads/fonts/” rather than “/downloads/?c=fonts/”. I wonder if there is any way of making it see the category value?
Cheers,
Jon VC#9
Offline
Re: Looking for a "if article's category =xx then" plugin
Jon, I’m currently using this tag just fine in r465 with clean URLs (section/id/title) so maybe it’s the way you are using it?
Just out of interest, if zem is still around, as these are conditionals are they covered by the latest EvalElse mods?
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline