Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2009-04-13 23:16:03
- woy
- Member
- Registered: 2009-04-08
- Posts: 18
Re: problem with combined section/category/article navigation
Mh, doesn’t fix it. I had removed ,<txp:category2 />' because I thought it’s superfluous due to the fact that I’ve assigned only a single category per article.
Last edited by woy (2009-04-13 23:18:26)
Offline
#17 2009-04-13 23:19:59
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: problem with combined section/category/article navigation
woy wrote:
I had removed
,<txp:category2 />'because I thought it’s superfluous due to the fact that I’ve assigned only a single category per article.
OK, that’s fine, but did you change <txp:category /> to <txp:category1 />?
Offline
#18 2009-04-13 23:21:55
- woy
- Member
- Registered: 2009-04-08
- Posts: 18
Re: problem with combined section/category/article navigation
<txp:if_category>
<txp:article_custom category='<txp:category />' form="content_link" wraptag="ul" class="content_nav" />
</txp:if_category>
<txp:if_individual_article>
<txp:article_custom category='<txp:category1 />,<txp:category2 />' form="content_link" wraptag="ul" class="content_nav" />
</txp:if_individual_article>
That’s how my [content_nav] form looks right now.
Offline
#19 2009-04-13 23:24:48
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: problem with combined section/category/article navigation
That’s really strange, because according to your tag trace it says this (inside the if_individual_article tags):
<txp:article_custom category='<txp:category />' form="content_link" wraptag="ul" class="content_nav" />
Offline
#20 2009-04-13 23:29:03
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: problem with combined section/category/article navigation
I just looked at your page, and I think I get it now: you indeed must leave out the ,<txp:category2 />, because it appears to tell Txp to look in all categories if there is no category2. So what happens if you just have <txp:category1 /> there?
Last edited by els (2009-04-13 23:29:57)
Offline
#21 2009-04-13 23:34:12
- woy
- Member
- Registered: 2009-04-08
- Posts: 18
Re: problem with combined section/category/article navigation
Wow, that’s it. I can’t repeat to say thank you again, Els.
Could you please tell me what makes the difference between '<txp:category />' and '<txp:category />'
Offline
#22 2009-04-13 23:37:59
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: problem with combined section/category/article navigation
Phew… I’m glad we found it :)
<txp:category /> looks for the category that is currently being viewed (= the category that is in the URL), so it only works on a category (list) page. <txp:category1 /> and <txp:category2 /> look at the category (1 or 2) that is assigned to the article currently viewed, so they only work on an individual article page.
Offline
#23 2009-04-13 23:42:27
- woy
- Member
- Registered: 2009-04-08
- Posts: 18
Re: problem with combined section/category/article navigation
Ah, good to know. Didn’t know that this makes such an significant difference.
Thanks and good night!
Offline
#24 2009-04-16 12:31:44
- woy
- Member
- Registered: 2009-04-08
- Posts: 18
Re: problem with combined section/category/article navigation
I’m sorry for reinvigorating this thread. After fixing this problem with Els’ help, I’m struggling with two related issues.
First one:
I’v marked my “news” section as “on front page” to display it when opening the website. My main navigation consist of a section list and I highlight the selected one using
<li<txp:if_section name='<txp:section/>'> class="active"<txp:else/> </txp:if_section>.
Is there a solution to declare the section “news” as selected although I’ve not navigated to it?
My second problem is linked to my the initial topic of this post:
Currently I put my articles in place using the following tag structure:
<txp:if_individual_article> <txp:article form="standard" /> <txp:else /> <txp:article status="sticky" form="standard" category='<txp:category>'/> </txp:if_individual_article>
I’m using sticky articles as landing pages for the sections. These articles have also a category assigned and I would like to have my category highlighted when I navigate to a section.
Can I achieve this without hard coding the navigation in my templates?
Thanks in advance,
Sebastian
Offline