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.

Display Category ID based on Member Group ID

August 06, 2013 8:28am

Subscribe [1]
  • #1 / Aug 06, 2013 8:28am

    Scott Harrington

    85 posts

    Hello, Im trying to find the best solution to display a certain category within a channel entry dependent on member group ID. The page itself is only displayed if a member is logged in, I then want to further specify the category displayed based on the ID of the member group.

    I have tried the following within the template.

    {if logged_in_group_id == "1" OR logged_in_group_id == "6"}
    {exp:channel:entries channel="store" transcribe="disable" category="102" orderby="title" sort="asc|desc"}
    {/if}
    {if logged_in_group_id == "7"}
    {exp:channel:entries channel="store" transcribe="disable" category="103" orderby="title" sort="asc|desc"}
    {/if}

    This displays nothing, I have therefore created a series of embeds which will contain the whole section of that page content which although works fine, means I’m doing a lot of duplicating content which is becoming messy and hard to manage.

    {if logged_in_group_id == "1" OR logged_in_group_id == "6"}
    {embed="includes/colour-uk"}
    {/if}
    {if logged_in_group_id == "7"}
    {embed="includes/colour-europe"}
    {/if}
    {if logged_in_group_id == "8"}
    {embed="includes/colour-row"}
    {/if}

    If anyone has any alternative solutions

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

ExpressionEngine News!

#eecms, #events, #releases