Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Need help making tagsoup ... ;)
It does something >
Form:
<txp:if_article_category number="2" name='<txp:category2 />'>
<div class="article">
<h3><txp:permlink class="active"><txp:title /></txp:permlink></h3>
</div>
<txp:else />
<div class="article">
<h3><txp:permlink><txp:title /></txp:permlink></h3>
</div>
</txp:if_article_category>
How can I tweak this to get only one team highlighted on all pages concerning that team, e.g. ‘Gemengd 35’ … ?
Thanks for helping me … to morrow it has to go ‘online’ … ahhhhhhh!
Offline
#14 2010-05-31 16:10:57
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Need help making tagsoup ... ;)
Joop, can you put the site in debug mode so that I can have a look at the tag trace?
Offline
Re: Need help making tagsoup ... ;)
In debug mode it is!
Offline
#16 2010-05-31 16:49:08
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Need help making tagsoup ... ;)
I assumed that all articles about a specific team have the team name for category 2 (and ‘teams’ for category 1). So these articles
- Gemengd 35+
- Gemengd 35+ team op weg naar Kampioenschap?
- 4e overwinning op rij voor Gemengd 35+ team
would all need to have:
- category 1 = teams
- category 2 = gemengd-35
Do they? If I’m wrong my code can’t work, and we may need to think of an alternative solution.
What my code is doing is this: if the article in the list (under ‘Teams’) has the same category 2 as the current individual article’s category 2, apply the active class.
Offline
#17 2010-05-31 16:54:17
- candyman
- Member
- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: Need help making tagsoup ... ;)
The title of this topic is very funny but, in the future, it will be quite difficult to search&find it for someone who has the same problem. Or a quick txptip is on the way when it will be solved? I hope so.
Offline
#18 2010-05-31 17:00:59
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Need help making tagsoup ... ;)
I will try and think of a more descriptive topic title when we have solved this ;)
Offline
#19 2010-05-31 17:09:50
- candyman
- Member
- From: Italy
- Registered: 2006-08-08
- Posts: 684
Re: Need help making tagsoup ... ;)
Not so important but I have the same problem and the browser bookmarks list tooooo loooong… ;)
I stay tuned. Thanks!
Offline
Re: Need help making tagsoup ... ;)
Els wrote:
Do they? If I’m wrong my code can’t work, and we may need to think of an alternative solution.
What my code is doing is this: if the article in the list (under ‘Teams’) has the same category 2 as the current individual article’s category 2, apply the active class.
They do!
[edit]
Sorry … they do not! Article ‘Gemengd 35+’ has ‘teams’ as category 1 and ‘gemengd-35’ as category 2.
Articles ’4e overwinning op rij voor Gemengd 35+ team’ and ‘Gemengd 35+ team op weg naar Kampioenschap?’ have ‘(empty)’ as category 1 and ‘gemengd-35’ as category 2
Article ‘Heren 35+’ has ‘teams’ as category 1 and ‘heren-35’ as category 2; there are no other articles about ‘Heren 3+’
The other team articles don’t have a second category yet!
With your code the results are:
Last edited by RedFox (2010-05-31 21:18:50)
Offline
#21 2010-05-31 21:09:39
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Need help making tagsoup ... ;)
Then I should have said ‘what my code was meant to do’… I’ll have another look.
Offline
Re: Need help making tagsoup ... ;)
Els, look at my post (edit!) before your last one. I indeed making things up … sorry!
Offline
#23 2010-05-31 21:20:45
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Need help making tagsoup ... ;)
Can you try this:
<h4>Teams:</h4>
<txp:if_individual_article>
<txp:variable name="teamname" value='<txp:category2 />' />
<txp:article_custom section="competitie" category="teams" form="excerptonlytitle_active" time="any" offset="" sort="position asc" />
<txp:else />
<txp:article_custom section="competitie" category="teams" form="excerptonlytitle" time="any" offset="" sort="position asc" />
</txp:if_individual_article>
Form:
<txp:if_article_category number="2" name='<txp:variable name="teamname" />'>
<div class="article">
<h3><txp:permlink class="active"><txp:title /></txp:permlink></h3>
</div>
<txp:else />
<div class="article">
<h3><txp:permlink><txp:title /></txp:permlink></h3>
</div>
</txp:if_article_category>
Offline
Re: Need help making tagsoup ... ;)
Offline