Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: if_individual_article vrs. if_section
Els i see the beauty the article tag in conjunction with form and listform attributes now. But now im trying to think in what circumstances would i use the if_individual_article tag if i can just use the form and listform properties?
its a bad hen that wont scratch itself.
photogallery
Offline
#14 2008-10-15 17:38:48
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: if_individual_article vrs. if_section
You’ll probably find a use for it when you stick with Txp :) A couple of examples:
You can use it to style individual article pages differently, for instance by adding markup elements inside the if_individual_article tags on your page:
<txp:if_individual_article>
<div class="red">
<txp:else />
<div class="green">
</txp:if_individual_article>
On the default page template that comes with Txp it is used for pagination:
<txp:if_individual_article>
<div class="divider"><img src="<txp:site_url />images/1.gif" width="400" height="1" alt="---" title="" /></div>
<p><txp:link_to_prev>« <txp:prev_title /></txp:link_to_prev>
<txp:link_to_next><txp:next_title /> »</txp:link_to_next></p>
<txp:else />
<p><txp:older>« <txp:text item="older" /></txp:older>
<txp:newer><txp:text item="newer" /> »</txp:newer></p>
</txp:if_individual_article>
And if you wish you can still use it for article display instead of making use of the article tag’s context sensitivity: instead of using form
and listform
attributes you can have <txp:article form="oneform" />
and one article form like this:
<txp:if_individual_article>
code for individual article
<txp:else />
code for article list
</txp:if_individual article>
Offline