Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-08-05 07:23:18
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
r1620 - possibly thisarticle/sticky article solution
See here for background.
I think this changes the old status semantics slightly on individual article pages. Now, <txp:article />
will only display a Live article, not Sticky, even on a Sticky article’s permlink page. (Previously, I believe <txp:article />
tried to be smarter, and fetch the article regardless of whether the status was Live or Sticky).
In other words, this:
<txp:article status="sticky" />
<txp:article />
..should work fine on both list pages and individual article pages without displaying duplicate articles.
YMMV.
Alex
Offline
Re: r1620 - possibly thisarticle/sticky article solution
If you want to achieve the old way can you still do <txp:article status="sticky,live" />
?
I found it a useful way of flagging only certain articles for showing on the front page as a teaser whilst leaving the normal article list with both live and sticky articles in the respective section intact.
TXP Builders – finely-crafted code, design and txp
Offline
Re: r1620 - possibly thisarticle/sticky article solution
Jakob, you can still use
<txp:article status="sticky" />
<txp:article status="live" />
zem, you’re right about the semantics change. This considered, the commit looks fine for my test case regarding sticky/live stati.
Last edited by wet (2006-08-05 18:06:41)
Offline
#4 2006-08-06 00:53:09
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: r1620 - possibly thisarticle/sticky article solution
can you still do
<txp:article status="sticky,live" />
?
No. I don’t believe that has ever been supported.
It’s not trivial to do, either. txp:article behaves differently depending on whether it’s displaying a sticky or live article; how should it behave if it’s displaying both? Lots of consequences and complex interactions.
Wet’s suggestion works and is much simpler.
Last edited by zem (2006-08-06 00:53:24)
Alex
Offline
Re: r1620 - possibly thisarticle/sticky article solution
thanks for the info. Wet’s suggestion lists the sticky articles at the top, though, rather than all articles in their normal order. I’ll have to try it out with a current update or maybe find another way of flagging individual articles to appear as teasers on the front page.
TXP Builders – finely-crafted code, design and txp
Offline
Re: r1620 - possibly thisarticle/sticky article solution
jakob wrote:
[…] rather than all articles in their normal order.
I am confused :-(
What purpose would you use sticky articles for if they were rendered in posting date order? I always use them as an introductory article to a specific section article list, even restricting them to be displayed only on the very first page of an article list.
I think I am missing something…
Offline
Re: r1620 - possibly thisarticle/sticky article solution
I agree, I am not using them entirely as they were conceived, but as a way of flagging certain articles to appear on the front page. Imagine a normal website (not a blog) with sections and pages within them. The client could then set some to status=“sticky”, whether recent or not, and these would appear on the front page as teasers and otherwise in their normal position in their own section. I guess, I should use another way of flagging them in future.
TXP Builders – finely-crafted code, design and txp
Offline
#8 2006-08-06 22:01:36
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: r1620 - possibly thisarticle/sticky article solution
Yeah, that would actually be an unintended “feature”.
I guess, I should use another way of flagging them in future.
Sure. You could use categories, or custom fields, for one. With custom fields, you could even make a plugin that has say, a dropdown or checkbox, rather than text to enter. A category might be worth investigating because, usually, frontpage articles are of the same “type”.
Offline
Re: r1620 - possibly thisarticle/sticky article solution
Yes, thanks (again) for the ideas :-) I’ll revisit here again before upgrading.
TXP Builders – finely-crafted code, design and txp
Offline