Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
syntax problem: <txp:if_category name="cat1,cat2,cat3">?
i am trying to do this:
<txp:if_category name=“deutsch,english,multilang”>
/<txp:category2 title=“y” />
</txp:if_category>
but it seems multiple mentioning of category names in that tag need a special syntax. i can’t seem to be able to find that. any help?
A hole turned upside down is a dome, when there’s also gravity.
Offline
#2 2006-11-01 14:22:24
- anoke
- Archived Plugin Author
- Registered: 2006-04-15
- Posts: 152
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
Is that in page or in form? I kept mixing <txp:if_article_category> and <txp:if_category> very long..
(manual says about category2 that you should be using “title=1” btw)
- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -
Offline
#3 2006-11-01 14:40:00
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
The way you are using that tag is correct as is.
It is intended for use in a page/column context and looks at an article search by category for conditional selection?
Offline
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
thanx for the hint regarding the context and the appropriate tag. wwas that a manual for 4.0.4 and if so, could you point me on where to find this?
apart from that…
it turned out i needed the if_article_category tag, since i am using this in a form, only this tag doesn’t allow multiple entry of categories (that’s somethign for the wishlist i guess)
as of the title attribute in the txp:category1 (or 2) tag it seems, that
<txp:category1 title=“y” /> and
<txp:category1 title=“1” />
both display the case-sensitive title of the category (in 4.0.4) whereas
<txp:category1 title=“n” /> and
<txp:category1 title=“0” />display the name of the category as a case-insensitive value
i noticed though, that using this value as a search value needs awareness of case-sensitivity again.
but get back again to the syntax issue:
i found that the syntax i used was RIGHT. see first post above.
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
thanx rick,
…looks at an article search by category for conditional selection…
was the expression i was searching for. or at least i couldn’t find another use for the multiple category names yet, than if wanting to set multiple category name searches yielding to the same results.
Last edited by jayrope (2006-11-01 14:51:38)
A hole turned upside down is a dome, when there’s also gravity.
Offline
#6 2006-11-01 14:52:06
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
<txp:if_article_category>
is what you want.
(Problem is I’m afraid I might have also found a bug with that tag, just a day or two ago. :S )
Edit: bah, stupid internet is flaky again, sittin’ here takin’ it’s sweet time while the world goes by…
Last edited by Mary (2006-11-01 14:59:22)
Offline
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
mary, is that bug affecting input of multiple categories as a name attribute? and: does it make sense to watch teh timeline still for possible fixes or is that currently mixing with crockery?
A hole turned upside down is a dome, when there’s also gravity.
Offline
#8 2006-11-01 15:03:26
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
Yeah, it does – it seems to not work properly unless your article has two categories assigned (if it’s only got one then it doesn’t). Could you confirm whether that’s so? A fix for it would go into the dev branch, into the next maintenance release (which should be soon, since we’ve had a few fixes of late).
Offline
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
mary, the problem i have searching for this possible error is the search term, what is the name for a category, which i didn’t assign?
in other words:
<txp:if_article_category name=“english,deutsch”>
/<txp:category2 title=“1” />
</txp:if_article_category>
does not put out anything over here, whereas
<txp:if_article_category name=“english”>
/<txp:category2 title=“1” />
</txp:if_article_category>
plus
<txp:if_article_category name=“deutsch”>
/<txp:category2 title=“1” />
</txp:if_article_category>
lists/prints the languages from cat2 (all of this in an article form called from an article_custom tag in a page) as i wanted. this affects all article and not just the ones, which have only one category assigned, it seems.
Last edited by jayrope (2006-11-01 15:14:20)
A hole turned upside down is a dome, when there’s also gravity.
Offline
#10 2006-11-01 15:19:58
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
Hmm. Might be a different manifestation of the same bug, but I can’t be sure off-hand. I’ll have to do some more testing. Thanks.
Offline
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
mary, btw, you see what i do here.
it uses the code posted above. multiple name attributes are not being recognized, it seems even regardless of there is one or two categories assigned to an article
stop. i have to recheck. will take a little while since i have to make a test form first.
Last edited by jayrope (2006-11-01 15:23:13)
A hole turned upside down is a dome, when there’s also gravity.
Offline
Re: syntax problem: <txp:if_category name="cat1,cat2,cat3">?
okay i can confirm that
<txp:if_article_category name=“deutsch,english,multilang”>
/<txp:category1 title=“y” />
/<txp:category2 title=“y” />
<txp:else />
</txp:if_article_category>
does not display anything, regardless of the article has one or two categories assigned.
edit: this is in version 4.0.4 with sencer’s update on taghandlers.php and aswell 10 additional custom fields edited into publish.php, txp_article.php and DB ,-)
Last edited by jayrope (2006-11-01 15:42:21)
A hole turned upside down is a dome, when there’s also gravity.
Offline