Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-07-26 14:20:23
- quinceginger
- Member
- From: Romania
- Registered: 2006-08-21
- Posts: 29
display a list of articles by category from sections not set to appear
on first page?
More clearly, I have posted articles in a section (“xyz”) that is not set to appear on first page. Some are in the “abc” category. When I select the “abc” category the articles in the “xyz” section are not shown. What is the solution to this problem?
Thank you!
qg
Offline
Re: display a list of articles by category from sections not set to appear
Try using the <txp:article_custom /> tag and telling it which section/s category/s you want to appear.
Last edited by thebombsite (2008-07-26 14:27:27)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: display a list of articles by category from sections not set to appear
if I have understund your request:
maybe:
<txp:article_custom category="abc" section="xyz" />
Cheers.
Offline
#4 2008-07-26 14:48:22
- quinceginger
- Member
- From: Romania
- Registered: 2006-08-21
- Posts: 29
Re: display a list of articles by category from sections not set to appear
Thank you Stuart and Dragondz!
Indeed <txp:article_custom /> was the solution. I’ve fixed the problem.
However, I think it would have been more natural for txp to allow articles by default when a category link is followed, even if the some articles belong to a section that is denied first-page display.
But maybe there are other reasons that I do not comprehend for this behaviour.
Anyway, txp is a great tool.
Bye,
qg
Last edited by quinceginger (2008-07-26 14:49:13)
Offline
Re: display a list of articles by category from sections not set to appear
Well by default TXP sends category lists to the front-page. You can control this behaviour within the category link itself but you can also have some extra control by using a conditional block in your page templates something like <txp:if_category><txp:article_custom /><txp:else /><txp:article /></txp:if_category>
adding the appropriate attributes to the 2 article tags. Remember that <txp:article />
is “context-sensitive” so will only allow articles from the current section except on the front-page where it allows articles from those sections set to appear there from the “Sections” tab. Whilst it might appear “unnatural” at first it does give you a lot more control.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#6 2008-07-29 15:59:10
- quinceginger
- Member
- From: Romania
- Registered: 2006-08-21
- Posts: 29
Re: display a list of articles by category from sections not set to appear
Thanks, Stuart!
Indeed, I have used the second approach, with the <txp:if _category> conditional.
Tudor
Offline