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.
DimensionContent entities) without violating its core patterns. The use of PrependExtensionInterface for entity extension is a clean, Sulu-native approach, avoiding custom Doctrine configurations.unlocalized_keys/localized_keys) and entity overrides, enabling zero-code changes for basic use cases while allowing deep customization (e.g., custom entities via page_class).NavigationLinkTypeResolver bypasses Sulu’s TemplateResolver to expose custom fields, ensuring template access without modifying Sulu’s core template system. This is critical for dynamic features like redirect tracking.resolve_target_entities trick replaces Sulu’s original class references at container build time, eliminating proxy generation in production. This is a highly effective optimization but requires understanding of Doctrine’s proxy mechanics.page_additional_data.xml/article_additional_data.xml.PreviewFormViewBuilder auto-registers the Additional Data tab, but this could conflict with custom tab registrations. The bundle provides no built-in conflict resolution.Page/Article via PrependExtensionInterface, the bundle’s overrides may cause class loading conflicts or unintended behavior.page_class: App\Entity\CustomPage).additionalData JSON field. Malformed data could corrupt the database or break templates.NavigationLinkEnhancer depends on Sulu’s page_link_dimension_content_enhancer. If Sulu changes this enhancer’s behavior (e.g., in a minor version), the bundle may break.auto_generate_proxy_classes in production is a double-edged sword. While it reduces deploy overhead, it shifts proxy generation to cache:warmup, which could increase deploy time for large projects.cache:warmup time in staging and consider parallelizing proxy generation if needed.unlocalized_keys/localized_keys could lead to data duplication (e.g., localized fields stored unlocalized) or missing translations.ConfigurableInterface) and document common pitfalls.Page/Article? If so, how will the bundle’s PrependExtensionInterface integration interact with existing overrides? Should we disable the bundle’s entity extensions and use a custom page_class instead?additionalData field (e.g., required fields, nested structure)? If so, how will we enforce them (form XML, Doctrine constraints, or application logic)?sourceLink/sourceUuid? For example:
cache:warmup time a critical path for deploys? If so, should we avoid disabling proxy generation or explore alternative optimizations (e.g., pre-generating proxies in CI)?Media, Product)? If so, the bundle’s design (configurable page_class/article_class) is a strength, but we may need to abstract the entity extension logic further.additionalData JSON field be handled in database backups/restores? JSON columns can be tricky with some migration tools.NavigationLinkEnhancer?Page + PageDimensionContent).NavigationLinkTypeResolver).#[Route]).composer.json and config/packages/sulu.yaml).Page/Article and document conflicts.composer.json:
composer require alengo/sulu-content-extra-bundle
config/bundles.php:
Alengo\SuluContentExtraBundle\AlengoContentExtraBundle::class => ['all' => true],
# config/packages/prod/doctrine.yaml
when@prod:
doctrine:
orm:
auto_generate_proxy_classes: false
config/packages/alengo_content_extra.yaml:
alengo_content_extra:
page:
form_key: page_additional_data
unlocalized_keys:
- template_theme
localized_keys:
- notes
article:
enabled: true
mkdir -p config/forms
touch config/forms/page_additional_data.xml
touch config/forms/article_additional_data.xml
Example 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>
How can I help you explore Laravel packages today?