putyourlightson/craft-sift

Filters entries/categories/submissions that can be selected to only those that match a user's categories.

1.1.1 2020-06-04 08:26 UTC

This package is auto-updated.

Last update: 2024-11-04 17:52:19 UTC


README

A plugin for Craft CMS 3 that filters entries/categories/submissions that can be selected to only those that match a user's categories.

Requirements

Craft CMS 3.0.0 or later.

Installation

Install the plugin using composer.

composer require putyourlightson/craft-sift

Configuration

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',
        ],
    ],
];

Fieldtype

The plugin adds a Read-only Categories fieldtype that is visible to all users but that only admins can edit.

License

This plugin is licensed for free under the MIT License.

Created by PutYourLightsOn.