Content that is specific to one user-group

I am looking for help with a particular simple problem. Below is an outline:

I have created a user group, lets say it is called “VIP”. Users can apply for this group and be approved by admin. Currently I can use this to create categories and products that are seen only by VIP members.

My aim is to create additional custom code elsewhere on the site that is ONLY seen by “VIP” users. For example, inserting custom text into the header of the site that says “VIP Access”:

{if usergroup = VIP} Content Here {/if}

Can anyone help me with this?

Best Regards


{if $auth.usergroup_ids == '2'}

Where '2' is your VIP usergroup ID.

Apply those {if} loops on block wrapper templates (make a renamed copy, eg. mainbox_general.tpl and its copy with the usergroups flags as mainbox_general_vip.tpl). You can then apply the appropriate wrapper to blocks you only want VIP members to see.

Thanks, but I cannot get this code to work. The user group I am trying to create custom code for is '6'. I have tested your code multiple times and still nothing within {if}{/if} will show.

Any ideas?


{if $auth.usergroup_ids[2] == 6}

Worth mentioning that this works in 4.2

I use this, so thanks!

Try to use this code

{if 6|in_array:$auth.usergroup_ids}Content Here{/if}

[color=#262626][font=arial, sans-serif][size=3]Where '6' is your VIP usergroup ID.[/size][/font][/color]

[color=#262626][font=arial, sans-serif][size=3]Thank you.[/size][/font][/color]

Please follow also our FREE add-on Product Tabs Per User Groups

I hope that helps,

[color=#282828][font=arial, verdana, tahoma, sans-serif]—[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]Valentin[/font][/color]

[color=#808080][font=arial, verdana, tahoma, sans-serif][size=2]part of[/size][/font][/color][color=#282828][font=arial, verdana, tahoma, sans-serif] [/font][/color]

Please check also our Additional Block Settings module

Maybe our “Blocks by usergroups” add-on will help you.