Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Excluding an article from a list
This is probably very obvious but… I can’t figure it out.
I don’t want an article to appear in the listing for a particular section.
I’ve tried making them sticky and using the status="4" searchsticky="0" pgonly="0"
attributes but it still appears.
Cheers,
Lawrence
Offline
#2 2009-01-10 16:34:40
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Excluding an article from a list
lozmatic wrote:
status="4" searchsticky="0" pgonly="0"
Those are all the default values for these attributes, so you can as well leave them out.
A default article list should leave sticky articles out of it. What exactly is the code you are calling the article list with (including any conditionals like if_section)?
Offline
Re: Excluding an article from a list
Hi, the code is: <txp:article_custom form="list.apartments" section="apartments" sort="rand()" limit="1" pgonly="0" />
It’s wrapped in a @<txp:if_category /> conditional.
Offline
Re: Excluding an article from a list
pgonly
is an attribute for the txp:article
tag, not article_custom. Note that article_custom will always return an article list and is context insensitive.
You can use article instead of article_custom to remove a sticky article from your results.
Offline
#5 2009-01-11 13:22:37
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Excluding an article from a list
Well, article_custom uses status="live"
by default as well, so it shouldn’t return sticky articles. Lawrence, are you sure the sticky article is displayed by this tag, you don’t have another tag on your page that is displaying it?
Offline
Re: Excluding an article from a list
Ah, I had another article tag in there messing things up.
Thank you an sorry!
Offline
Pages: 1