- 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.