New "members only" tags

Just added a two useful tags to snippets to determine if a user is, or is not a member of a particular role.

We just added a two useful tags to snippets to determine if a user is, or is not a member of a particular role. Try these two examples ….

1{% member_of Staff, Site Administrator %}
2   Yes! I am a member of one of the roles.
3{% endmember_of %}

The above example will only display the content is the current user is a member of any of the listed roles.

Alternatively, if you want to do the opposite and you want content displayed only if the current user is not a member of any of the listed roles, then try this …

1{% not_a_member_of Staff %}
2   I am not a member of staff.
3{% endnot_a_member_of %}

If you need to build a members only area, then you will definitely need these two tags.

by Craig Sullivan
launch.ly

8 May 2012