perspeqtive/sulu-snippet-manager-bundle
最新稳定版本:1.3.1
Composer 安装命令:
composer require perspeqtive/sulu-snippet-manager-bundle
包简介
Transform snippets in custom managers
README 文档
README
The Sulu Snippet Manager Bundle adds configurable snippet-based navigation items to the Sulu Admin interface. This allows you to organize snippets by type and permissions within the native Sulu Admin UI.
🚀 Features
- Custom navigation items for different snippet types
- Optional nested navigation items (e.g. under a main “Configuration” item)
- Independent permission handling per snippet type and snippet navigation item
- Easy custom snippet list view per snippet type
- Hide default snippet area with snippet types, where a certain permission is not given
🛠️ Installation
Install the bundle via composer:
composer require perspeqtive/sulu-snippet-manager-bundle
Enable the bundle
Register it in your config/bundles.php:
return [ // ... PERSPEQTIVE\SuluSnippetManagerBundle\SuluSnippetManagerBundle::class => ['all' => true], ];
🛠️ Configuration
Create a configuration file at config/packages/sulu_snippet_manager.yaml. Here you define how and where your snippet navigation items appear in the Sulu Admin UI.
Example configuration:
sulu_snippet_manager: navigation: configuration: navigation_title: "Configuration" type: "configuration" order: 39 icon: "su-news" children: settings: navigation_title: "Settings" type: "settings" order: 0 icon: "su-settings" snippet_list_view: "my-custom-view" account: navigation_title: "Account Settings" type: "account" order: 1 icon: "su-account" services: navigation_title: "Services" type: "services" order: 41 icon: "su-services"
Configuration keys explained:
| config item | required | description |
|---|---|---|
| navigation_title | yes | Label shown in the Sulu Admin navigation |
| type | yes | The snippet type, when it is not a nested parent item. When it is a parent item, just use an unique identifier |
| order | yes | Sort order position |
| icon | no | Sulu icon name (e.g. su-settings, see icon overview) |
| children | no | Nested navigation items — parent items with children act as groups without detail views, parents without children behave like normal list views |
| snippet_list_view | no | The custom list view xml, where the view is configured |
Permissions
Each snippet automatically receives its own permission key. These permissions are independent from the global snippet permissions in Sulu.
You can assign user roles to control access (view, add, edit, delete) to each snippet separately.
⚠️ Important: Users without the required permission won’t see the corresponding navigation item in the Sulu Admin UI.
👩🍳 Contribution
Please feel free to fork and extend existing or add new features and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and adapt the documentation.
统计信息
- 总下载量: 478
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-06-18