Go to main content

If logged in




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) as well as the global attributes :

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.

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