Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-05-24 20:18:39

TheUsability
Member
Registered: 2005-05-03
Posts: 51

Stickyness w/ TXP:Newer / Older

I’m currently display my “sticky” articles via the regular process described in the FAQ. What stinks, though, is that the sticky article not only appears on the front page as a first article, but also as the first article on every other page generated via TXP:Newser / TXP:Older. Is there a way around this, i.e. put the sticky article only on the real front page / real section front page.

Cheers,
_TU

Offline

#2 2006-05-24 23:03:16

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Stickyness w/ TXP:Newer / Older

Sure: use if_individual_article or if_article_list. FAQ.


Alex

Offline

#3 2006-05-24 23:05:44

TheUsability
Member
Registered: 2005-05-03
Posts: 51

Re: Stickyness w/ TXP:Newer / Older

I use if_article_list already. That’s not the problem – the sticky articles don’t appear in individual articles (and shouldn’t). Problem is, they still appear on each article list page generated by TXP:Older. But they should only appear on the first page (i.e. front).

Cheers,
_TU

Last edited by TheUsability (2006-05-24 23:06:46)

Offline

#4 2006-05-27 10:07:28

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,275
Website

Re: Stickyness w/ TXP:Newer / Older

Fresh from the press: wet_if_page

Offline

#5 2006-05-27 23:40:51

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: Stickyness w/ TXP:Newer / Older

Fair enough. So what’s the ideal solution here? txp:article status=“sticky” only works on the first page, by default?


Alex

Offline

#6 2006-05-28 04:55:24

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Stickyness w/ TXP:Newer / Older

Erm, a setting would be good (i.e: “show_once”?), I can see uses for the same sticky showing on every page (like section descriptions, etc).

Offline

#7 2006-05-28 12:17:39

TheUsability
Member
Registered: 2005-05-03
Posts: 51

Re: Stickyness w/ TXP:Newer / Older

I’d say there should be a way to influence this, i.e. Mary’s idea – “show_once” as part of txp:article or something. Both should be possible. In my case, I only need it on the front page, others may need it on all.

wet_if_page looks promising, gonna try that – great to have been an inspiration, wet :)

Cheers,
_TU

Last edited by TheUsability (2006-05-28 19:54:42)

Offline

#8 2006-05-28 19:54:01

TheUsability
Member
Registered: 2005-05-03
Posts: 51

Re: Stickyness w/ TXP:Newer / Older

Just tested it – works great!

There’s one more thing I’d like to see: A way to contain sticky articles to the front page. Right now, they always appear in their section AND on the front page. Any idea on that one?

Last edited by TheUsability (2006-05-28 19:58:04)

Offline

#9 2006-05-29 06:46:53

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Stickyness w/ TXP:Newer / Older

Use if_section? I’m not sure of what you mean so that may not be helpful…

Offline

#10 2006-05-29 07:12:19

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,275
Website

Re: Stickyness w/ TXP:Newer / Older

zem wrote:

Fair enough. So what’s the ideal solution here? txp:article status=“sticky” only works on the first page, by default?

One could easily argue that this should be expanded to exclude sticky articles from search results, too. This can become quite a thicket.

Thus, I’d prefer a conditional tag over more intrinsics in txp:article. Yields flexibility, avoids pre-thought solutions which can never cover every use case.

I’ve sent a patch to add a new tag txp:if_page. If it won’t make it in the core, there’s still the plug-in. I’d just encourage to add a test for a special condition of a site into the core, as I see a natural fit there resembling if_author, if_section et al.

Offline

#11 2006-05-29 07:52:38

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: Stickyness w/ TXP:Newer / Older

One could easily argue that this should be expanded to exclude sticky articles from search results, too.

Er, they already do (searchsticky parameter)?

Offline

#12 2006-05-29 07:57:05

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,275
Website

Re: Stickyness w/ TXP:Newer / Older

Mary wrote:

Er, they already do (searchsticky parameter)?

No, I didn’t mean the searchable index but the results list (excerpts).

Offline

Board footer

Powered by FluxBB