Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2008-10-05 00:18:58
- charlbury
- New Member
- Registered: 2008-10-04
- Posts: 2
New to textpattern need to understand <txp:if_individual_article>
Can anyone point me in the direction of more information on the <txp:if_individual_article> tag.
I can’t get my head around how textpattern knows when to show the full article and when it only shows part of the article.
What is an “individual article”? I’m trying to use the code below in the default page to show the excerpt via the defaul form and the full article via the my_articledisplay form but it’s not working. Anu pointers much appreciated.
<h2>DEFAULT PAGE</h2>
<txp:if_individual_article>
<p>INDIVIDUAL ARTICLE</p>
<txp:article form=“my_articledisplay” />
<txp:else />
<p>NOT INDIVIDUAL ARTICLE</p>
<txp:article limit=“2” />
</txp:if_individual_article>
Offline
#2 2008-10-05 01:20:40
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: New to textpattern need to understand <txp:if_individual_article>
TXP’s <txp:article /> tag returns either an article list or a single article depending on the presence of an article id in the url for the current page. The index page will return an article list because no article id is defined. If you click on the article link in the default install you can see the difference in the urls. I find it easiest to describe the difference as modes, “individual article” or “article list”.
TXP’s <txp:if_individual_article> tag is a conditional tag that returns true if the url reflects an article id, and false if it does not; the difference is significant as one learns their way around TXP’s template system.
In most templates I’ve seen the article tag is called prior to the conditional like so:
<h2>DEFAULT PAGE</h2>
<txp:article form=“my_articledisplay” limit=“2” />
<txp:if_individual_article>
<p>INDIVIDUAL ARTICLE</p>
<txp:else />
<p>NOT INDIVIDUAL ARTICLE</p>
</txp:if_individual_article>
you might look at the differences with article_custom to shed some light on the question.
Last edited by rsilletti (2008-10-05 01:30:07)
Offline