Error Notices · 12.04.04
The <txp:notice /> tag
This tag is intended to be used by plugins developers when they need to send to the users an error message, without break TXP internal “mechanism”.
The error message needs to be specified as the value of the message attribute.
For example, if you misuse an image tag, you’ll obtain a notice saying “malformed image tag” notifying you that something is wrong with the tag. This message is the resulting output of: <txp:notice message=”malformed image tag” />
* * *
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.
* * *
Feed Tags · 11.04.04
TXP allow us to provide quick links to our XML feeds, both for articles and links.
The <txp:feed_link /> tag
We can use this tag to create links to an XML feed of our articles. This feed can be both RSS and Atom.
Among the common attributes label, wraptag and limit, this tag can also take the following ones:
- flavor: The XML format you want to use for this feed. One of rss or atom.
- category: The category for the items to be displayed. If you specify this attribute, only the articles with the given category will be shown.
- section: The section for the items to be displayed. If you specify this attribute, only the articles with the given section will be shown.
The <txp:link_feed_link /> tag
With this tag we can create a link to the XML feed for our links.
Among the common attributes label, wraptag and limit, this tag can also take the following ones:
- category: The category for the items to be displayed. If you specify this attribute, only the articles with the given category will be shown.
- flavor: The XML format you want to use for this feed. One of rss or atom. (Note: This attribute is not avaliable through TXP TAG BUILDER until γ1.17b).
* * *
Images · 11.04.04
The <txp:image /> tag
Using this tag, you can display the image you want, using the id attribute.
We can easily obtain the id attribute value for anyone of the images we’ve uploaded througt TXP: go to the “Write>Images” section, click on the textpattern link correspondent to your image, and you’ll obtain a nice <txp:image /> tag with the correct id attribute.
Once we’ve got our tag, we can customize it with any of the following attributes:
- style: the styles you want to apply to the image. (This is the XHTML style attribute).
- align: The alignment you want to specify for this image. This is also the XHTML align attribute equivalent; so, the correct values can be one of: bottom, middle, top, left or right. (Note that this attribute is deprecated since HTML 4.01 so, if you want standards compliance pages, you shouldn’t use it).
* * *
Search results · 3.04.04
The next group of tags will be used by TXP to display your site search results if you create a form called search_results and place them inside. (If this form doesn’t exists, TXP will use a default format to display search results). Tags allowed in a search_results form – all referred to articles which match the search criteria – are:
- <txp:search_result_date />: The date you’ve posted the article.
- <txp:search_result_excerpt />: a small excerpt of the article, containing the searched word(s) highlighted with a XHTML <strong> tag.
- <txp:search_result_title />: A link to the found article, with the article title a text.
- <txp:search_result_url />: A link to the found article, with the article URL as text.
* * *
