Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2008-02-05 01:00:24
- jim_01
- Member
- Registered: 2008-01-17
- Posts: 35
Sticky articles
I want to add code to keep sticky articles at the top, but i think my code is a bit messed up.
I currently have:
<txp:if_article_list>
<! — list page: display the short version — >
<txp:rss_auto_excerpt length=“230” ending=”…” wrapreadmore=“1” linkwraptag=“span” linktext=“Read more”/>
<txp:else />
<! — article page: display the complete article — >
<txp:body />
</txp:if_article_list>
<txp:if_comments>
<div class=“commentlink”><p><txp:comments_invite /></p>
</div>
</txp:if_comments>
Can anyone help?
Offline
Re: Sticky articles
You need to use txp:article_custom or txp:article to show your article content, as article-tags can’t be used within list. if on list they will need <txp:article />
-tag – and inside it’s form article tags.
Second thought: is that your article form’s content? If yes, what is your article-tag looking? ;)
Last edited by Gocom (2008-02-05 01:16:41)
Offline
Re: Sticky articles
You need to use 1 article tag and 1 article_custom tag in your page template.
Use <txp:article_custom status="sticky" section="sectionName" limit="1" form="formName" />
or similar to call the sticky article then your normal article tag to call the other articles. Remember that article_custom is NOT context-sensitive so you may need to specify the section. Don’t use 2 article tags as this may cause problems with double-comments.
The code you show above should be in a form template.
Also you should use <txp:if_comments_allowed></txp:if_comments_allowed>
for your comment invite. The way you have it now won’t show up unless there is already a comment.
Last edited by thebombsite (2008-02-05 01:21:30)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Pages: 1