Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-03-25 16:35:29
- fangonk
- Member
- Registered: 2007-07-12
- Posts: 44
Displaying other articles from the same category?
Ok, I spent a really long time looking at similar posts but I still can’t seem to come up with a good solution for this. When a user opens an article, I also want the archive page to display a list of articles in the same category directly below it. I have gathered that supertag is probably the best way to go about this but I just can’t seem to get it to work.
Here is what I am using:
<txp:if_category>
<txp:asy_wondertag><txp:article_custom category=”<txp:category />” /></txp:asy_wondertag>
<txp:else />
<txp:article_custom limit=“4” listform=“article_listing” />
</txp:if_category>
Can anyone give me some suggestions?
Offline
#2 2008-03-25 17:42:45
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: Displaying other articles from the same category?
I have a feeling you’re complicating matters unnecessarily.
Check out txp:related_articles or txp:article_custom for more control over the output.
Offline
Re: Displaying other articles from the same category?
masa is right. First, category isn’t active when viewing post so you can’t use txp:if_category
, it’s only relative to the category list your viewing, not a single article.
You could use <txp:related_articles />
or this:
<txp:if_individual_article>
<txp:asy_wondertag>
<txp:article_custom category="<txp:category1 />" form="your-form" />
</txp:asy_wondertag>
</txp:if_individual_article>
Offline
#4 2008-03-25 18:34:40
- fangonk
- Member
- Registered: 2007-07-12
- Posts: 44
Re: Displaying other articles from the same category?
Jesus, making stuff too complicated – the story of my life. Thanks for the help – is there anything northern europeans can’t do?!
Offline