Go to main content

If article author

Contents

Syntax

<txp:if_article_author>

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

<txp:if_article_author>
    …conditional statement…
</txp:if_article_author>

The tag will execute the contained statement if the author name associated with a particular article matches the value of the name attribute. Should be used in an ‘article’ type form.

Note: The name attribute requires an author’s login name not their real name.

Attributes

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

name="author"
Comma-separated list of author names.
Default: unset (i.e. any author at all).

Examples

Example 1: Display some text dependent on an article’s author

<p>
    <txp:author />
    <txp:if_article_author name="admin">
        (Administrator)
    </txp:if_article_author>
</p>

Displays article author name, then displays the text “(Administrator)” if the article was written (posted) by the author admin.

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. :)