alengo/sulu-content-extra-bundle
Extends Sulu CMS 3.x Pages and Articles with an Additional Data tab, built-in entities, configurable mapping for localized/unlocalized fields, auto entity registration, navigation link markers, and sortable template groups. PHP 8.2+, Symfony 7.
PrependExtensionInterface) to extend core Page/Article classes without breaking existing associations. This aligns with Sulu’s dimensioned-content model (e.g., PageDimensionContent), ensuring compatibility with localization, preview, and admin workflows.NavigationLinkEnhancer, adding sourceLink/sourceUuid markers to template data. This enables dynamic routing logic (e.g., conditional UI based on linked content) without modifying core Sulu templates.PreviewFormViewBuilder auto-registers the "Additional Data" tab, reducing frontend integration effort.alengo/sulu-content-extra-bundle).bundles.php.page_additional_data.xml).alengo_content_extra.yaml) maps fields to unlocalized (shared across languages) or localized (per-dimension) storage, aligning with Sulu’s multilingual architecture.NavigationLinkTypeResolver exposes sourceLink/sourceUuid to templates via the navlink section, bypassing Sulu’s TemplateResolver to avoid key filtering. Works with Twig/Symfony templates out of the box.resolve_target_entities replaces Sulu’s original class references at container build time, enabling auto_generate_proxy_classes: false in production.| Risk Area | Mitigation Strategy | Severity |
|---|---|---|
| Sulu Version Lock | Bundle requires Sulu 3.0.6+; downgrades may break entity mappings. | High |
| JSON Schema Validation | No built-in validation; custom forms must enforce constraints (e.g., regex, max length). | Medium |
| Form Definition Overhead | Requires manual XML forms (e.g., page_additional_data.xml), adding initial setup work. |
Medium |
| Proxy Generation in Dev | Disabling proxies in production (auto_generate_proxy_classes: false) adds cache:warmup overhead during deploys. |
Low |
| Template Key Conflicts | sourceLink/sourceUuid markers may clash with existing template variables. |
Low |
| Performance Impact | JSON storage adds minor overhead to entity hydration; negligible for most use cases. | Low |
template_theme, campaign_id, seo_overrides) should be stored in the "Additional Data" tab? Are any localized or shared across languages?sourceLink/sourceUuid markers be used in templates? Examples:
auto_generate_proxy_classes: false) for the performance benefits?Media, Block)? The bundle’s architecture supports this via configuration.additionalData), requiring no custom migrations.NavigationLinkTypeResolver exposes markers to templates via the navlink section, ensuring compatibility with Sulu’s templating system.composer require alengo/sulu-content-extra-bundle
Register the bundle in config/bundles.php:
Alengo\SuluContentExtraBundle\AlengoContentExtraBundle::class => ['all' => true],
config/packages/alengo_content_extra.yaml:
alengo_content_extra:
page:
unlocalized_keys: [template_theme]
localized_keys: [notes]
article:
enabled: true
config/forms/page_additional_data.xml):
<form xmlns="...">
<key>page_additional_data</key>
<properties>
<property name="template_theme" type="select" mandatory="false">
<meta><title lang="en">Theme</title></meta>
<params><param name="values" type="collection"><param name="default" type="collection"><param name="title" value="Default"/><param name="name" value="default"/></param></param></params>
</property>
</properties>
</form>
config/packages/prod/doctrine.yaml:
when@prod:
doctrine:
orm:
auto_generate_proxy_classes: false
php bin/console cache:warmup to generate proxies during deploy.Page/Article data remains intact.NavigationLinkTypeResolver ensures sourceLink/sourceUuid are available in templates without modifying Sulu’s TemplateResolver.resolve_target_entities handles class replacements at container build time.alengo_content_extra.yaml.page_additional_data.xml with 2–3 fields).sourceLink/sourceUuid usage in templates (e.g., conditional logic for link-type pages).How can I help you explore Laravel packages today?