Conditional tags · 12.04.04
TXP conditional tags are special tags intended to be used when we want to display the results of a template fragment only when a given condition is true.
This tags are:
- <txp:if_comments></txp:if_comments>: true when there are comments for a given article.
- <txp:if_individual_article></txp:if_individual_article>: true when we’re in a single article page
- <txp:if_article_list></txp:if_article_list>: true when we’re on a page with a list of articles (front page, category, section, search results…).
All of them are container tags so, the fragment we want to display only when the given condition is true, must be placed inside one of these tags.
You can see an example of if_individual_article and if_article_list on the Article Navigation Tags of this manual.
About the if_comments tag, since the logic behind this tag is that, when used on an article form, everything inside this tag will only appear if commenting for the article is open, or was open in the past; you can use it to add to your articles forms comment related things.
* * *