Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-06-14 12:08:15
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
section and category specific articles - possible?
Sections: mexico, usa
Categories: people, travel, culture
On domain.com/mexico I want to display three lists of article titles specific to mexico. List one should be “people” articles, list two should be “travel” articles and list three “culture” articles
Txp:article is context sensitive so will display all mexico articles but I can not split them up into categories since it doesn’t have such an attribute.
Txp:article_custom can be split up into categories via an attribute but it is not context sensitive so will show articles from mexico and usa
Is there any way round this, perhaps via a plugin?
Last edited by stef25 (2006-06-14 12:09:21)
I need someone to protect me from all the measures they take in order to protect me
Offline
#2 2006-06-14 12:18:25
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
Re: section and category specific articles - possible?
Sorry, article_custom can be made context sensitive by adding a section attribute. However I don’t want to hard code the section name into my template so I can re use it for every template
Possible?
I need someone to protect me from all the measures they take in order to protect me
Offline
#3 2006-06-14 13:40:29
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: section and category specific articles - possible?
<code><txp:if_section name=“mexico”>
<txp:article_custom section=“mexico” category=“people” />
<txp:article_custom section=“mexico” category=“travel” />
<txp:article_custom section=“mexico” category=“culture” />
</txp:if_section>
<txp:if_section name=“usa”>
<txp:article_custom section=“usa” category=“people” />
<txp:article_custom section=“usa” category=“travel” />
<txp:article_custom section=“usa” category=“culture” />
</txp:if_section>
</code>
Offline
#4 2006-06-14 14:11:18
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
Re: section and category specific articles - possible?
brilliant!
how can i repay all the help im getting here? is any hosting space needed?
I need someone to protect me from all the measures they take in order to protect me
Offline
#5 2006-06-14 14:42:27
- els
- Moderator

- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: section and category specific articles - possible?
stef25 wrote:
how can i repay all the help im getting here?
Just have fun using Txp and buy a t-shirt :)
Offline