Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#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

#2 2008-07-26 14:26:44

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

#3 2008-07-26 14:28:19

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

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

#5 2008-07-27 09:29:04

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

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

Board footer

Powered by FluxBB