ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Conditional template code based on user group

July 22, 2010 3:00pm

Subscribe [2]
  • #1 / Jul 22, 2010 3:00pm

    heaversm

    197 posts

    Hi - I’m trying to do this:

    {exp:member:custom_profile_data}
        {if member_group == "Super Admins"}
            CONTENT
        {/if}
    {/exp:member:custom_profile_data}

    but it’s not working. Is there some other way to accomplish this?

  • #2 / Jul 22, 2010 4:42pm

    The Tactile Group

    118 posts

    I believe member_group accepts member group id’s not names.
    Something like this should work.

    {if member_group == "1"} 
    CONTENT
    {/if}
  • #3 / Jul 22, 2010 4:45pm

    Ingmar

    29245 posts

    {member_group} returns the ID number for the currently logged-in user. This would be 1 for Superadmins.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases