Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2005-11-28 23:26:14
- -rr-
- Member
- Registered: 2005-09-11
- Posts: 73
Re: [howto] taking advantages of status="live" and status="sticky"
I dont find the sticky behavior logical at all. I want sticky articles to show at the top of an article list all the time. When an article is selected from the list, however, the sticky article disappears from the top of the list even though I want it to stay there. Heres the code I’m using:
<code>
<txp:article category=“Articles” listform=“titleonly” status=“sticky” />
<txp:chh_article_custom category=“Articles” listform=“titleonly” />
</code>
-
Logically I would think this would show sticky articles at the top of the list at all times… but instead they only show in the section frontpage???
Last edited by -rr- (2005-11-28 23:27:00)
Offline
Re: [howto] taking advantages of status="live" and status="sticky"
It is logical. Your front-page is a list, your back-page is in “individual_article” mode. Have you tried adding the sticky tag to your back-page template as well, assuming you have a separate template for it, or within the “if_individual_article” tags? I’m not sure if it will work mind you.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: [howto] taking advantages of status="live" and status="sticky"
As thebombsite said, it is logical.
Your articles are sticky in an article-list context (/section frontpage).
When you are in an individual-article context (/section/myarticle), the txp:article tag will only output the called article (myarticle).
So, to show an sticky in both individual-article and article-list context I will use txp:article_custom and the id="" attribute, where the value should be the ID of the sticky article you want to show in both context.
Offline
#19 2005-11-29 13:23:21
- -rr-
- Member
- Registered: 2005-09-11
- Posts: 73
Re: [howto] taking advantages of status="live" and status="sticky"
There has to be another way.
I can’t use the <code>id=”“</code> attribute, because it’s too much asked for the users to understand how to use it. Teaching them all how to set the article as sticky is much simpler.
How can change the code to make it visible? I’ve tried without success.
Offline
Re: [howto] taking advantages of status="live" and status="sticky"
rr wrote:
I want sticky articles to show at the top of an article list all the time. When an article is selected from the list, however, the sticky article disappears from the top of the list even though I want it to stay there.
I can’t use the <code>id=”“</code> attribute, because it’s too much asked for the users to understand how to use it. Teaching them all how to set the article as sticky is much simpler.
rr, what are you exactly trying to achieve?
As far as I understand, you want that an “sticky” article stays at the top, both in article-list an individual-article context.
I can understand that you want to keep that “sticky” at the top in an article-list, but do you want to keep the whole “sticky” at top also when you are reading another article (individual-article)?
Mmmm… now… i think I understand.
This is a job for txp:article_custom.
Try:
<txp:article_custom section="thesection" status="sticky" limit="1" />
txp:article_custom is not context-sensitive, that is why you have to use the “section” attribute.
The “problem” is that you will have to set this once per each section you want to achieve your goal (to show an sticky article both in article-list and individual-article context), using some conditionals (if_section) or different page templates.
How can change the code to make it visible? I’ve tried without success.
I didnt understand.
Offline