agence-raid/sulu-site-configuration-bundle
Composer 安装命令:
composer require agence-raid/sulu-site-configuration-bundle
包简介
Sulu CMS bundle for managing per-webspace site configuration
README 文档
README
Adds a Configuration tab in the Sulu webspace view to manage per-webspace, per-locale site settings (phone, email, social links, logo, etc.) stored as a flexible JSON entity.
Installation
1. Require the package
composer require agence-raid/sulu-site-configuration-bundle
2. Register the bundle
In config/bundles.php:
AgenceRaid\SuluSiteConfigurationBundle\SuluSiteConfigurationBundle::class => ['all' => true],
3. Register the routes
In config/routes/admin.yaml:
agence_raid_sulu_site_configuration_admin: resource: '@SuluSiteConfigurationBundle/config/routes/admin.yaml'
4. Run the migration
bin/adminconsole doctrine:migrations:diff bin/adminconsole doctrine:migrations:migrate
5. Create your form
Create config/forms/webspace_configs/default.xml with the fields you need:
<?xml version="1.0" ?> <form xmlns="http://schemas.sulu.io/template/template" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.sulu.io/template/template http://schemas.sulu.io/template/form-1.0.xsd"> <key>site_configuration</key> <properties> <property name="logo" type="single_media_selection"> <meta> <title lang="fr">Logo</title> </meta> </property> <property name="website_email" type="text_line"> <meta> <title lang="fr">Email</title> </meta> </property> </properties> </form>
To override the form for a specific webspace, create config/forms/webspace_configs/{webspace-key}.xml with key site_configuration_{webspace-key}.
6. Grant permissions
Go to Settings → Roles in the Sulu admin and grant {webspace-key}.configuration permissions to the relevant roles.
Usage
In Twig templates
{{ site_config('website_email') }}
{{ site_config('phone', '+33 0 00 00 00 00') }}
{% set logo = sulu_resolve_media(site_config('logo').id, app.request.locale) %}
<img src="{{ logo.url }}" alt="Logo" />
In PHP services
use AgenceRaid\SuluSiteConfigurationBundle\Service\SiteConfigurationService; public function __construct( private readonly SiteConfigurationService $configurationService, ) {} $email = $this->configurationService->get('my-webspace', 'fr', 'website_email'); $all = $this->configurationService->getAll('my-webspace', 'fr');
agence-raid/sulu-site-configuration-bundle 适用场景与选型建议
agence-raid/sulu-site-configuration-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 agence-raid/sulu-site-configuration-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 agence-raid/sulu-site-configuration-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-14