Usergroups selection as checkboxes
To install Usergroup Field, follow these steps:
- Download & unzip the file and place the
usergroupfield
directory into yourcraft/plugins
directory - -OR- do a
git clone https://github.com/quebecstudio/usergroupfield.git
directly into yourcraft/plugins
folder. You can then update it withgit pull
- -OR- install with Composer via
composer require quebecstudio/usergroupfield
- Install plugin in the Craft Control Panel under Settings > Plugins
- The plugin folder should be named
usergroupfield
for Craft to see it. GitHub recently started appending-master
(the branch name) to the name of the folder for zip file downloads.
Usergroup Field works on Craft 2.4.x and Craft 2.5.x.
Add usergroup selection to entries, categories or assets for special features ex: Prevent some entries to be shown for specific users.
To verify if a usergroup is selected within the field:
{% if currentUser.groups|intersect(myentry.myusergroupfield) %}
{# do something with myentry... #}
{% endif %}
- Add settings to show all groups or only specific groups in the field.
Plugin development by Québec Studio
Icon designed by Madebyoliver from Flaticon