Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Sulu Content Extra Bundle

Sulu Content Extra Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Additional Data tab for Sulu CMS Pages and Articles — generic JSON field with configurable key mapping

Frequently asked questions about Sulu Content Extra Bundle
How do I add an Additional Data tab to Sulu Pages without creating custom entities?
The bundle auto-registers the tab via `PreviewFormViewBuilder` for Pages and Articles. Just install the package and define your form fields in `page_additional_data.xml` or `article_additional_data.xml` in your `Resources/config/admin` directory. No custom entities are required unless you override defaults.
What’s the difference between unlocalized_keys and localized_keys in the YAML config?
Unlocalized fields (e.g., `template_theme`) are stored once per record in the base entity, while localized fields (e.g., `notes`) are stored per language in the `DimensionContent` entity. Misconfiguring these can cause data duplication or missing translations, so validate your YAML carefully.
Will this bundle work with Sulu 3.0.5 or earlier?
No, the bundle requires **Sulu 3.0.6+** due to Doctrine/Gedmo compatibility fixes for mapped-superclass entities. Older versions may need manual patches or won’t work at all. Always check the [Sulu changelog](https://github.com/sulu/sulu/blob/3.0/CHANGELOG.md) for breaking changes.
How do I expose additional data to Twig templates (e.g., for dynamic redirects)?
Use the `NavigationLinkEnhancer` to add `sourceLink`/`sourceUuid` markers to link-type pages. These are automatically exposed to templates via `NavigationLinkTypeResolver`. Access them in Twig with `{{ page.sourceLink }}` or similar, depending on your template logic.
Can I disable the Additional Data tab for Pages but keep it for Articles?
Yes. Set `enabled: false` under the `page` key in your `alengo_content_extra.yaml` config while leaving `article` enabled. This is useful if you only need additional data for one content type. Example: `page: { enabled: false }` and `article: { unlocalized_keys: [...] }`.
What happens if another bundle or my project already extends Sulu’s Page/Article entities?
The bundle uses `PrependExtensionInterface` to extend entities, which can conflict if another bundle or your project also overrides `Page`/`Article`. To avoid issues, disable the bundle’s auto-registration by setting `page_class` or `article_class` in your config to point to a custom entity, then manually merge the bundle’s logic.
How do I validate the JSON data stored in additionalData to prevent corruption?
The bundle doesn’t include built-in JSON validation, but you can enforce it via **XML form definitions** (e.g., add a `JSONSchema` validator in your `page_additional_data.xml`) or **Doctrine lifecycle callbacks** (e.g., `prePersist`/`preUpdate` in a custom entity). For strict validation, combine both approaches.
Does this bundle support sorting admin tabs (e.g., reordering the Additional Data tab)?
Yes, the `SortedGroupProvider` decorates Sulu’s metadata group provider to order form groups (including your Additional Data tab) based on `sulu_admin.template_group.*` keys in your `translations/admin+intl-icu.{locale}.yaml`. Edit these keys to control tab appearance order.
What’s the performance impact of disabling Doctrine proxy generation in production?
Disabling `auto_generate_proxy_classes` reduces deploy overhead but shifts proxy generation to `cache:warmup`, which can slow down deploys for large projects. Benchmark your `cache:warmup` time in staging and consider parallelizing proxy generation if it becomes a bottleneck.
Are there alternatives to this bundle for adding custom fields to Sulu Pages/Articles?
Yes, you could manually extend `Page`/`Article` entities or use Sulu’s **SmartContent** for dynamic fields, but those require custom entities or XML forms. This bundle provides a **zero-entity** solution with built-in admin UI integration, making it ideal for projects needing quick, configurable additional data without deep customization.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nasirkhan/laravel-sharekit
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony