Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2010-04-15 22:34:55

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: List of articles with current category

<txp:article /> is context sensitive, so on an individual article page it will only ever display that individual article. If you still want the article lists on individual article pages, you’ll need to use <txp:article_custom />, and place the code outside the if_category tags. Instead of <txp:article /> you can use <txp:article_custom section='<txp:section />' category='<txp:category />' />. But then you’ll have another problem:

And I don’t understand this behaviour because your code fills the lists according to the current category. I don’t see how the category changes. After clicking on a list item I get url/section/category/article. (Before: url/section/category).

So you are using gbp_permanent_links. I don’t know if you’ve noticed that the ‘category’ in the URL /section/category/article is always either the article’s category1 or category2 (you can set that in the permanent link rule settings). Let’s say it’s set to category1. If a visitor clicked a link on a category page in the second list, an individual article is displayed that has the requested category as its category2, but category1 will be in the URL. And the latter determines the value of <txp:category />.

Offline

#17 2010-04-16 07:04:00

bmwg
Member
Registered: 2010-04-06
Posts: 39

Re: List of articles with current category

Thanks.
I think I’ll use keywords to seperate the items. Seems easier.

Offline

Board footer

Powered by FluxBB