A plugin for Craft CMS 3 that filters entries/categories/submissions that can be selected to only those that match a user's categories.
Craft CMS 3.0.0 or later.
Install the plugin using composer.
composer require putyourlightson/craft-sift
Copy the src/config.php
config file to craft/config
as sift.php
, adding the entry field handles and the associated user field handles.
return [
'*' => [
/**
* The field handles to sift by for entry queries
*/
'entryFieldHandles' => [
'entryFieldHandleA' => 'userFieldHandleA',
'entryFieldHandleB' => 'userFieldHandleB',
],
],
];
The plugin adds a Read-only Categories fieldtype that is visible to all users but that only admins can edit.
This plugin is licensed for free under the MIT License.
Created by PutYourLightsOn.