Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pull in a sticky article at top of category page
I want to dynamically pull in a sticky article at the top of a category page. The following works great on a section page, but does nothing on a category page:
<txp:article status="sticky" limit="1" />
Any ideas for what else to try?
Offline
Re: Pull in a sticky article at top of category page
I think if_category will be your friend…
Offline
Re: Pull in a sticky article at top of category page
Hmm, I don’t see how to use txp:if_category to fix this. I can use that to pull in other stuff, but it doesn’t give txp:article the power to check for sticky articles assigned to the current category.
Offline
Re: Pull in a sticky article at top of category page
Oh that’s different – what about something like:
<txp:if_category name='<txp:category />'>
<txp:article status="sticky" limit="1" />
</txp:if_category>
Offline
Re: Pull in a sticky article at top of category page
Or:
<txp:if_category>
<txp:article_custom status="sticky" limit="1" category='<txp:category />' />
</txp:if_category>
Offline
Re: Pull in a sticky article at top of category page
Would be nice if either of those worked, but they don’t for me!
Do they both work for you?
Offline
Re: Pull in a sticky article at top of category page
Oh, I should mention I’m using rss_unlimited_categories. That could well be related.
Offline
Re: Pull in a sticky article at top of category page
Never used that plugin so I don’t know. You could try and turn it off and see what happens with my code…
Offline
Re: Pull in a sticky article at top of category page
Thanks so much for your help, Jonathan! You’ve definitely been a big hep in giving me a sense of where things are breaking.
The more I dig into this, the more it looks like this is related to rss_unlimited_categories. Which I need for other stuff .Grumble
Offline
#10 2009-06-16 22:38:00
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: Pull in a sticky article at top of category page
Sorry in advance if I didn’t understand well but can’t you just use:
<txp:article_custom status="sticky" category="<txp:category />" section="<txp:section />" limit="1" />
?
Offline
Re: Pull in a sticky article at top of category page
Redbot, yes, thanks—I’m pretty sure that (and jstubbs’s examples) would work fine if I wasn’t using rss_unlimited_categories.
But with rss_unlimited_categories in play, neither txp:article_custom nor txp:article can make use of a category name (whether via txp:category or a static category name).
As best I can tell, I’ll need to use the rss_unlimited_categories_article_list tag. But the problem there is that it doesn’t seem to have a status attribute or otherwise be able to see sticky articles.
A conundrum indeed.
Last edited by floodfish (2009-06-16 22:50:28)
Offline
#12 2009-06-16 23:03:08
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: Pull in a sticky article at top of category page
Oh, ok.
Unfortunately I never used rss_unlimited_categories so I can’t give you advice, sorry.
Anyway I’d have a look at smd_query (if you have a minimal mysql knowledge) which will probably help.
Offline