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.

If logged in as custom member group!

July 18, 2007 4:33am

Subscribe [2]
  • #1 / Jul 18, 2007 4:33am

    Riverboy

    2993 posts

    How to make links inside “if logged in” tag to show certain links only to special member group members?

  • #2 / Jul 18, 2007 4:58am

    silenz

    1651 posts

    group_id
    {if group_id == '7'}
    You’re an “Editor”!
    {/if}

  • #3 / Jul 18, 2007 5:02am

    Riverboy

    2993 posts

    So this should work just fine then:

    {if logged_in}
    <a href="http://{path=member/memberlist}">Members</a> 
    
    
    
    {if group_id == '7'}
    
    <a href="http://{path=template_group/template}">Special page</a>
    {/if}
    
    {/if}

    ?

  • #4 / Jul 18, 2007 5:37am

    silenz

    1651 posts

    This is supposed to work, yes.

    All logged in users ought to see the Members-link.
    And only users that belong to member group 7 ought to see the Special-link.

  • #5 / Jul 22, 2007 4:15pm

    Riverboy

    2993 posts

    What about if want to put 2 different groups to that variable? I did try this:

    {if group_id == '7|8'}

    but it didnt work…

  • #6 / Aug 25, 2007 3:02pm

    Riverboy

    2993 posts

    So there is no other way to do that than put so many {if}s as needed? (it makes file bigger…).

  • #7 / Aug 25, 2007 5:59pm

    Anonymouse

    9 posts

    you could use an if with two conditions

    {if group_id == '7' || group_id == '5'}
      Special Output Here
    {/if}

  • #8 / Aug 25, 2007 6:53pm

    Riverboy

    2993 posts

    ah that way it shortens the list of if’s. thanks!
    - Tuittu

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

ExpressionEngine News!

#eecms, #events, #releases