sulu/theme-bundle
Composer 安装命令:
composer require sulu/theme-bundle
包简介
The Sulu Bundle which provides theming functionality.
README 文档
README
The SuluThemeBundle provides the functionality to add multiple themes for different look and feel using multiple webspaces in the Sulu content management system.
To achieve this, the bundle uses the SyliusThemeBundle to render different twig templates and asset files. Each webspace can have it's own theme.
🚀 Installation and Usage
Install the bundle
Execute the following composer command to add the bundle to the dependencies of your project:
composer require sulu/theme-bundle
Enable the bundle
Enable the bundle by adding it to the list of registered bundles in the config/bundles.php file of your project:
return [ /* ... */ Sulu\Bundle\ThemeBundle\SuluThemeBundle::class => ['all' => true], ];
Configure the SyliusThemeBundle
In order to use the bundle you have to add at least the following default configuration:
# ./config/packages/sylius_theme.yaml sylius_theme: sources: filesystem: ~
By default, the bundle seeks for the themes in the %kernel.project_dir%/themes directory and looks for a
theme configuration file named composer.json. This can be changed via the yaml configuration:
sylius_theme: sources: filesystem: filename: theme.json
For more detailed information about the configuration sources go to the SyliusThemeBundle documentation.
Configure your themes
Every theme must have its own configuration file in form of a theme.json.
Go to the Theme Configuration Reference
for the detailed documentation about the configuration options.
The minimal configuration for a theme would be the following:
// ./themes/<theme-name-1>/theme.json { "name": "vendor/<theme-name-1>" }
It is important, that the name matches the naming convention of composer (vendor/name).
Create a theme
First you have to create the directory themes inside your project.
To create a theme you have to create a new directory in the themes folder with the name of the new theme.
In the newly created directory you have to add the theme configuration file theme.json.
See Configure your themes. Additonally you have to create the templates directory next to
the theme.json. Afterwards you have to fill this folder with all the used templates and assets for this theme.
This results in the following project structure:
ProjectName
├── composer.json
├── assets
├── bin
├── config
├── templates
├── themes
│ ├── <theme-name-1>
│ │ ├── templates
│ │ │ └── base.html.twig
│ │ └── theme.json
│ └── <theme-name-2>
│ ├── templates
│ │ └── base.html.twig
│ └── theme.json
├── ...
└── ...
Add one of your themes to a webspace
Each webspace can use a different theme. A theme can be enabled for a specific webspace by adding the theme name
<theme>vendor/theme-name</theme> to your webspace:
<!-- ./config/webspaces/example.xml --> <webspace xmlns="http://schemas.sulu.io/webspace/webspace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.sulu.io/webspace/webspace http://schemas.sulu.io/webspace/webspace-1.1.xsd"> <name>example.com</name> <key>example</key> ... <theme>vendor/theme-name</theme> ... </webspace>
❤️ Support and Contributions
The Sulu content management system is a community-driven open source project backed by various partner companies. We are committed to a fully transparent development process and highly appreciate any contributions.
In case you have questions, we are happy to welcome you in our official Slack channel. If you found a bug or miss a specific feature, feel free to file a new issue with a respective title and description on the the sulu/SuluThemeBundle repository.
📘 License
The Sulu content management system is released under the under terms of the MIT License.
sulu/theme-bundle 适用场景与选型建议
sulu/theme-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 306.34k 次下载、GitHub Stars 达 23, 最近一次更新时间为 2016 年 05 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「theme」 「sulu」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sulu/theme-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sulu/theme-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sulu/theme-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Bundle for creating forms in Sulu.
The bundle provides command to migrate the Sulu database from phpCr to the SuluContentBundle.
Simple News Bundle for Sulu 2 CMS
A Bootstrap 4.x base theme for SilverStripe
Lucency Theme
Package to generate configuration and boilerplate code in Sulu
统计信息
- 总下载量: 306.34k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 23
- 点击次数: 17
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-24