This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hi, All,
I'd like to make some partial to show only for users they belong to group "xyz".
How can I write it in template?
Code is just "Demo" template from October CMS, I created the group "vip" and pasted this code in partial footer:
{% if user.inGroup('vip' ) %}
Some example text for VIP user
{% endif %}
Then I become that error
Last updated
I'm pretty sure for the Rainlab.User plugin the code would look something like this.
{% for group in user.groups %}
{% if group.name == 'vip' %}
Some example text
{% endif %}
{% endfor %}
Last updated
It works! Thanks a lot
ndcisiv said:
I'm pretty sure for the Rainlab.User plugin the code would look something like this.
{% for group in user.groups %} {% if group.name == 'vip' %} Some example text {% endif %} {% endfor %}
1-10 of 10