Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-11-09 16:44:00
- Nonsense
- Member
- Registered: 2005-11-25
- Posts: 53
Sticky not working!
I’ve been trying to use sticky articles and place at the top of a page if there is an article list, but they wont show up.
Here’s my code:
<txp:if_individual_article>
<txp:article form="Archives" listform="Archives-list" />
</txp:if_individual_article>
<txp:if_article_list>
<txp:article form="Archives" listform="Archives-list" status="sticky" />
<txp:article form="Archives" listform="Archives-list" limit="5" />
</txp:if_article_list>
I even tried this
<txp:article form="Archives" listform="Archives-list" status="sticky" />
<txp:article form="Archives" listform="Archives-list" limit="5" status="live" />
But then the live articles wont show up.
Last edited by Nonsense (2008-11-09 16:50:10)
Offline
#2 2008-11-09 16:50:28
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: Sticky not working!
Please post the content of your “Archives-list” form.
— Steve
Offline
#3 2008-11-09 16:53:45
- Nonsense
- Member
- Registered: 2005-11-25
- Posts: 53
Re: Sticky not working!
<div class=“article”>
<div class=“section”>
<h2><txp:title /></h2>
<txp:article_image />
<div class=“regular”>
<txp:body />
<txp:rss_article_edit>Edit</txp:rss_article_edit>
</div>
</div>
</div>
Offline
#4 2008-11-09 16:59:23
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: Sticky not working!
How about…
<txp:if_individual_article>
<txp:article form="Archives" />
<txp:else />
<txp:article listform="Archives-list" status="sticky" />
<txp:article listform="Archives-list" limit="5" />
</txp:if_individual_article>
?
— Steve
Offline
#5 2008-11-09 17:07:10
- Nonsense
- Member
- Registered: 2005-11-25
- Posts: 53
Re: Sticky not working!
Well it looks better since you removed some unnesssary code, but no, that didn’t do anything I’m afraid.
Offline
#6 2008-11-09 17:10:18
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Sticky not working!
Is your sticky article in a section that can be displayed on that page? Otherwise you might need article_custom instead of article.
Offline
#7 2008-11-09 17:43:11
- Nonsense
- Member
- Registered: 2005-11-25
- Posts: 53
Re: Sticky not working!
Yes it’s the same section.
And I tried using article_custom but that didn’t work either.
Offline
#8 2008-11-09 18:00:28
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: Sticky not working!
Have you tried using the form attribute instead of listform? Just a thought…
Offline
#9 2008-11-09 18:08:31
- Nonsense
- Member
- Registered: 2005-11-25
- Posts: 53
Re: Sticky not working!
I tried:
<txp:article form="Archives" status="sticky" />
Nothing.
It seems that the status tag doesn’t work at all, either with live or sticky.
Strange.
Offline
#10 2008-11-09 18:12:24
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Sticky not working!
Can you post a tag trace? (instructions bottom of this FAQ)
Offline
#11 2008-11-09 18:28:12
- Nonsense
- Member
- Registered: 2005-11-25
- Posts: 53
Re: Sticky not working!
<txp:if_individual_article>
[<txp:if_individual_article>: false]
</txp:if_individual_article>
<txp:if_article_list>
[<txp:if_article_list>: true]
<txp:article listform="Archives-list" status="sticky" />
[SQL (0,001217): select *, unix_timestamp(Posted) as uPosted from textpattern where 1 and Status = 5 and Posted <= now() and Section = 'archives-tip' and custom_10 like 'sticky' order by Posted desc limit 0, 10]
<txp:article listform="Archives-list" limit="5" />
[SQL (0,000490): select count(*) from textpattern where 1 and Status = 4 and Posted <= now() and Section = 'archives-tip']
[SQL (0,000923): select *, unix_timestamp(Posted) as uPosted from textpattern where 1 and Status = 4 and Posted <= now() and Section = 'archives-tip' order by Posted desc limit 0, 5]
[artikel 395]
[SQL (0,000291): select Form from txp_form where name='Archives-list']
[Siddel: Archives-list]
<txp:title/>
<txp:article_image/>
<txp:body/>
<txp:newer>
</txp:newer>
<txp:older>
</txp:older>
</txp:if_article_list>
Language is set to Swedish.
Artikel = Article
Siddel = Form
Could this be related to this “hack” (which I did earlier):
http://gerhardlazu.com/blog/32/10-more-custom-fields-please
This looks like it could be a problem since I have 20 custom fields:
'archives-tip' and custom_10 like 'sticky'
Last edited by Nonsense (2008-11-09 18:43:46)
Offline
#12 2008-11-09 18:52:43
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Sticky not working!
Do you have a custom field named ‘status’? Certain names are reserved and can cause lots of trouble…
Offline