XF 2.2 Explode in isMemberOf() in template?

Andy R

Member
Is there any way to do something like:

Code:
$xf.visitor.isMemberOf(explode(',', $xf.options.comma_delimited_groups_custom_mod_option))

In a template?
 
If you want to check if user belong to group use in_array i don't know what look like this option comma_delimited_groups_custom_mod_option
but it should be user group callback and if it's you can check in template like this
HTML:
<xf:if is="in_array($xf.visitor.user_group_id, $xf.options.comma_delimited_groups_custom_mod_option)">
<!-- some code here -->
</xf:if>
 
I finally figured this out.. In the end, here is what worked:

Code:
$xf.visitor.isMemberOf($xf.options.comma_delimited_groups_custom_mod_option|split(','))
 
Last edited:
Back
Top Bottom