XF 2.1 Getting the group ID in a template

Nuno

Well-known member
Hi

I want to show a specific information in a template and I have an option group list where I can get the value from the selected groups with $xf.options.my_addon_group.

194407

In the template we have $xf.visitor.user_group_id, secondary_group_ids and display_style_group_id.
What's the best way to show this to the user with in the group?

Code:
<xf:if is="in_array($xf.visitor.user_group_id, $xf.options.my_addon_group)">

show to the group

</xf:if>

In this code, if the group is register it will show to all members, admin and mods.
I would like to show only to regular members id that matches the chosen option, or admin / mod /guest is that's whats is select.

Thanks
 
Top Bottom