tobimori / kirby-role-blueprints
Load different blueprints based on user roles in Kirby CMS
Fund package maintenance!
tobimori
Installs: 36
Dependents: 0
Suggesters: 0
Security: 0
Stars: 22
Watchers: 2
Forks: 0
Open Issues: 0
Type:kirby-plugin
Requires
- php: >=8.2.0
- getkirby/composer-installer: ^1.2.1
README
Simplified & automatic loading of different blueprints based on user roles in Kirby CMS.
Simply attach the role name as suffix to the blueprint file name and the plugin will load the corresponding blueprint.
Usage
site
└── blueprints
└── site.admin.yml -> Like site.yml, for admin users only
└── site.default.yml -> Any other user
└── pages
├── blog-post.admin.yml -> Like pages/blog-post.yml, for admin users only
├── blog-post.editor.yml -> Editor users only
└── blog-post.default.yml -> Any other user
Example
Since Kirby loads the blueprints normally as well, you can use a top-level extends
in your blueprint to change single items.
# site.default.yml title: overview tabs: main: # [...] seo: seo/site
# site.admin.yml extends: site.default tabs: admin: tabs/admin-tools
In this case, the admin tab will be appended after the seo tab.
Support the project
Note
This plugin is provided free of charge & published under the permissive MIT License. If you use it in a commercial project, please consider sponsoring me on GitHub to support further development and continued maintenance of my Kirby plugins.
License
MIT License Copyright © 2024 Tobias Möritz