If description

On this page:



The if_description tag is a conditional tag and always used as an opening and closing pair, like this…

    …conditional statement…

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


Tag will accept the following attributes (case-sensitive):

Textpattern context to check against. You can choose from the following contexts (set to empty to include all contexts):
article is this an article author list?
image is this an image author list?
file is this a file author list?
link is this a link author list?
Default: article.


Example 1: Supply meta tag if description exists

        <txp:meta_description />
    <txp:else />
        <meta name="description" content="A generic description fallback, possibly about bacon." />

Other tags used: else, meta_description.


Version 4.6.0

Tag support added

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