Category: Conditional tags

Textpattern documentation within the category ‘Conditional Tags’:

  1. Textpattern conditional tags

    Container tag in Textpattern are great for making lists and you use conditional tags to get there.

  2. Else

    The else tag is used within a containing conditional tag when the condition in the surrounding tag is not met.

  3. If article author

    The if_article_author tag will execute the contained statement if the author name associated with a particular article matches.

  4. If article category

    The if_article_category tag will execute the contained statement if the category name associated with a particular article matches.

  5. If article id

    The if_article_id tag will execute the contained statement if the article id associated with a particular article matches.

  6. If article image

    The if_article_image tag will execute the contained statements if an image is associated with the article being displayed.

  7. If article list

    The if_article_list tag will execute the contained statement if an article list is being displayed.

  8. If article section

    The if_article_section tag will execute the contained statements if the section name associated with a particular article matches.

  9. 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.

  10. 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.

  11. If comments

    The if_comments tag will execute the contained statements if there are comments associated with a particular article.

  12. 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.

  13. If disallowed

    The if_comments_disallowed tag will execute the contained statements if comments are disallowed for a given article.

  14. If comments error

    The if_comments_error tag will execute the contained statements when an error exists with the comments.

  15. If comments preview

    The if_comments_preview tag will execute the contained statements if a comment is being previewed.

  16. If custom field

    The if_custom_field tag will execute the contained statements if custom fields for a given article have content.

  17. If description

    The if_description tag will execute the contained statement if the current article/section/category's 'Description' field has an entry.

  18. If different

    The if_different tag will execute the contained statement when the value of the contained statement differs from the preceding value.

  19. If excerpt

    The if_excerpt tag will execute the contained statements if an excerpt is associated with the article being displayed.

  20. If expired

    The if_expired tag will execute the contained statements, if a particular article is expired.

  21. If expires

    The if_expires tag will execute the contained statements, if a particular article has an expiry date set.

  22. If first article

    The if_first_article tag will execute the contained statements if the displayed article is the first in the list.

  23. If first category

    The if_first_category tag will execute the contained statements if the current category is the first in the list.

  24. 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.

  25. 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.

  26. 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.

  27. If first section

    The if_first_section tag will execute the contained statements if the current section is the first in the list.

  28. If last category

    The if_last_category tag will execute the contained statements if the current category is the last in the list.

  29. 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.

  30. 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.

  31. 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.

  32. If last section

    The if_last_section tag will execute the contained statements if the current section is the last in the list.

  33. If plugin

    The if_plugin tag will execute the contained statements if the name attribute matches a currently installed plugin.

  34. If search

    The if_search tag will execute the contained statements if the called page is the result of a search.

  35. 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.

  36. If section

    The if_section tag will execute the contained statements if the called page is part of the section specified.

  37. If status

    The if_status tag will execute the contained statements depending on the requested page's HTTP status condition.

  38. If thumbnail

    The if_thumbnail tag will execute the contained statements if the current image has a thumbnail assigned to it.

  39. If variable

    The if_variable tag tests the existence and/or value of a global variable set with the variable tag.

  40. 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.

See something wrong in this document? Outdated info, a broken link, faulty code example, or whatever? Please write an issue and we’ll fix it.