Category: Conditional tags
Textpattern documentation within the category ‘Conditional Tags’:
-
Textpattern conditional tags
Container tags are great for making lists, and you can use conditional tags to get there.
-
Else
The else tag is used within a containing conditional tag when the condition in the surrounding tag is not met.
-
If article author
The if_article_author tag will execute the contained statement if the author name associated with a particular article matches.
-
If article category
The if_article_category tag will execute the contained statement if the category name associated with a particular article matches.
-
If article id
The if_article_id tag will execute the contained statement if the article id associated with a particular article matches.
-
If article image
The if_article_image tag will execute the contained statements if an image is associated with the article being displayed.
-
If article list
The if_article_list tag will execute the contained statement if an article list is being displayed.
-
If article section
The if_article_section tag will execute the contained statements if the section name associated with a particular article matches.
-
If author
The if_author tag will execute the contained statement if the called page is the result of an article search by a specific author's name.
-
If category
The if_category tag will execute the contained statements if the 'name' attribute matches a category search value, or the list is an article list by category.
-
If comments
The if_comments tag will execute the contained statements if there are comments associated with a particular article.
-
If comments allowed
The if_comments_allowed tag will test the article identified by the attribute for status and act, or not, according to that status.
-
If comments disallowed
The if_comments_disallowed tag will execute the contained statements if comments are disallowed for a given article.
-
If comments error
The if_comments_error tag will execute the contained statements when an error exists with the comments.
-
If comments preview
The if_comments_preview tag will execute the contained statements if a comment is being previewed.
-
If custom field
The if_custom_field tag will execute the contained statements if custom fields for a given article have content.
-
If description
The if_description tag will execute the contained statement if the current article/section/category's 'Description' field has an entry.
-
If different
The if_different tag will execute the contained statement when the value of the contained statement differs from the preceding value.
-
If excerpt
The if_excerpt tag will execute the contained statements if an excerpt is associated with the article being displayed.
-
If expired
The if_expired tag will execute the contained statements, if a particular article is expired.
-
If expires
The if_expires tag will execute the contained statements, if a particular article has an expiry date set.
-
If first article
The if_first_article tag will execute the contained statements if the displayed article is the first in the list.
-
If first category
The if_first_category tag will execute the contained statements if the current category is the first in the list.
-
If first file
The if_first_file tag will execute the contained statements if the displayed file is the first in the currently displayed file download list.
-
If first image
The if_first_image tag will execute the contained statements if the displayed image is the first in the currently displayed images list.
-
If first link
The if_first_link tag will execute the contained statements if the displayed link is the first in the currently displayed link list.
-
If first section
The if_first_section tag will execute the contained statements if the current section is the first in the list.
-
If last category
The if_last_category tag will execute the contained statements if the current category is the last in the list.
-
If last file
The if_last_file tag will execute the contained statements if the displayed file is the last in the currently displayed file download list.
-
If last image
The if_last_image tag will execute the contained statements if the displayed image is the last in the currently displayed images list.
-
If last link
The if_last_link tag will execute the contained statements if the displayed link is the last in the currently displayed link list.
-
If last section
The if_last_section tag will execute the contained statements if the current section is the last in the list.
-
If logged in
The if_logged_in tag will execute the contained statements if the current or given user is logged in and optionally a member of the given role.
-
If plugin
The if_plugin tag will execute the contained statements if the name attribute matches a currently installed plugin.
-
If request
The if_request tag will execute the contained statements if a page request variable match the given content.
-
If search
The if_search tag will execute the contained statements if the called page is the result of a search.
-
If search results
The if_search_results tag will execute the contained statements if the current article list contains a certain amount of entries matching a search.
-
If section
The if_section tag will execute the contained statements if the called page is part of the section specified.
-
If status
The if_status tag will execute the contained statements depending on the requested page's HTTP status condition.
-
If thumbnail
The if_thumbnail tag will execute the contained statements if the current image has a thumbnail assigned to it.
-
If variable
The if_variable tag tests the existence and/or value of a global variable set with the variable tag.
-
If yield
The if_yield tag tests the existence and/or value of a content set with the yield tag inside of an output_form container tag.
If you notice any kind of problem with this page's construction or content (outdated information, typos, broken links, or whatever), open an issue to have it sorted. Or have a go at it yourself. :)