Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: category1 & category2 attributes for article_custom tag
ruud wrote:
It’s a patch that makes it harder for TXP to switch to unlimited categories… if that is still a goal.
My thoughts exactly.
Offline
Re: category1 & category2 attributes for article_custom tag
am not sure if I understand “unlimited categories” correctly but can that be done with a wildcard perhaps? I really like the idea of a boolean category tag. With my limited understanding of TXP and SQL queries I could imagine the following is doable.
any category:
category=“.”
only “this” category
category=“this”
only “this”, “that” and “those” categories
category=“this,that,those”
only “this”, “that” and “those” categories but not “these”
category=“this,that,those,-these”
any category but “that”
category=“.,-that”
comma separates categories
wildcard could maybe be simplified with * only. Don’t know about the implications of this.
Hope this helps more than that it confuses you :-D
Good luck and thanks for all the fanastic work that has been done with TXP
Jeroen
Time to volunteer? Come and join us at a great project which is going to be opensource: https://www.caloom.com
Offline
#15 2010-11-05 16:46:44
- fantasmo
- Member
- Registered: 2010-05-05
- Posts: 40
Re: category1 & category2 attributes for article_custom tag
Hi,
does “category2” really work properly?
I tried to get rid of the link and tried
<txp:category2 link="0">and<txp:category2 title="1" link="0" /></txp:category2>
I have link="0"
in there two times but I also already tried to put only in the first position and only in the last.
But that doesn’t work, the category name is still a clickable link (I just want it as plain text with the “and” before.
Offline
#16 2010-11-05 18:07:27
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: category1 & category2 attributes for article_custom tag
When used as a container tag it always turns whatever is contained into a link. So all you need to do is remove the container.
Offline
#17 2010-11-08 08:37:56
- fantasmo
- Member
- Registered: 2010-05-05
- Posts: 40
Re: category1 & category2 attributes for article_custom tag
Ah ok, thank you. (I thought I could turn it off, because textbook gives me the “link”-attribute)
But one little thing still is: I need this “and” only if an article appears in two categories. I believe I need an “if-statement” or something to do this…but I was happy (i’m not a txp-pro) to find the “category2”-container which can do that except that I don’t want it as a link.
(For the first “category1” I already have it as just <txp:category1 />)
Offline
Re: category1 & category2 attributes for article_custom tag
fantasmo wrote:
But one little thing still is: I need this “and” only if an article appears in two categories.
<txp:if_article_category number="2">
<!--
We have category2.
-->
</txp:if_article_category>
See if_article_category.
Offline
#19 2010-11-08 13:04:30
- fantasmo
- Member
- Registered: 2010-05-05
- Posts: 40
Re: category1 & category2 attributes for article_custom tag
Oh, great that works…and wasn’t even that complicated ;-)
Offline
#20 2010-11-08 17:57:31
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: category1 & category2 attributes for article_custom tag
fantasmo wrote:
(I thought I could turn it off, because textbook gives me the “link”-attribute)
It is mentioned on the Textbook page:
When used as a containing tag, it will turn the contents into a link to that category.
but I agree it can easily be overlooked. So I added a note in the attribute’s description. Thanks for pointing it out!
Offline
Re: category1 & category2 attributes for article_custom tag
In 4.6 <txp:article(_custom) />
accepts match
attribute:
<txp:article_custom category="cats,dogs" match="Category1" ... />
with match="Category1,Category2"
by default.
Offline