If logged in

On this page:



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

    …content to show if logged in…

The tag will execute the contained statements if the current or given user is logged in and optionally a member of the given role.


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

group="user group"
Comma-separated list of user groups (publishing roles that the author belongs to).
Values: publisher, managing_editor, copy_editor, staff_writer, freelancer, designer, privs_none or corresponding integer(s).
Default: unset, the user may be assigned to any group.
Author name to test.
Default: current user (i.e. if anyone is logged in).


Example 1: Display an ‘Edit this article’ link for logged-in users

        <a href="<txp:site_url type="admin" />?event=article&step=edit&ID=<txp:article_id />">Edit this article</a>

Other tags used: article_id, if_individual_article, site_url.


Version 4.7.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.