Skip to content

Support contao twig slot layouts#34

Merged
koertho merged 20 commits intov2from
feature/twig_layout_support
Apr 20, 2026
Merged

Support contao twig slot layouts#34
koertho merged 20 commits intov2from
feature/twig_layout_support

Conversation

@koertho
Copy link
Copy Markdown
Contributor

@koertho koertho commented Apr 17, 2026

This PR add support for the new contao twig slot page layouts.
It also modernize some internal mechanic like page entrypoint evaluation.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for Contao “modern” (twig slot) page layouts by introducing a new entrypoint evaluation/builder pipeline and hooking asset injection into layout rendering, while modernizing some internal wiring and tooling config.

Changes:

  • Introduce EntryPointsBuilder/EntryPoint* types and use them to resolve active entrypoints from frontend, layout, and page inheritance.
  • Add a new layout event listener for injecting Encore tags in modern layouts; refactor legacy dynamic tag replacement to use the new builder.
  • Migrate DI config from services.yml to services.php and update CI/static analysis tooling configs.

Reviewed changes

Copilot reviewed 22 out of 23 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/Helper/ConfigurationHelper.php Adds isEnabledOnPage() API, deprecates isEnabledOnCurrentPage(), and adjusts enablement evaluation for modern layouts.
src/EventListener/InjectPageEntriesListener.php New listener to inject Encore link/script tags during layout rendering (modern layouts).
src/EventListener/Contao/ReplaceDynamicScriptTagsListener.php Refactors dynamic-tag replacement to build tags via the new entrypoint builder.
src/Event/EncoreEnabledEvent.php Extends event payload (layout), shifts to public properties, and deprecates getters.
src/EntryPoint/EntryPointsBuilder.php New builder to collect entrypoints from frontend asset + layout + page tree.
src/EntryPoint/EntryPoints.php New container for all/active entrypoints.
src/EntryPoint/EntryPointBuilderFactory.php Factory for creating EntryPointsBuilder with dependencies.
src/EntryPoint/EntryPoint.php New value object representing a resolved entrypoint.
src/Dca/EncoreEntriesSelectFieldOptions.php Uses constant for default field name.
src/Dca/EncoreEntriesSelectField.php Introduces NAME_DEFAULT constant for DCA field naming.
src/ContaoManager/Plugin.php Switches container config loading to config/services.php.
src/Asset/TemplateAssetGenerator.php Marks legacy generator as deprecated.
src/Asset/TemplateAsset.php Marks legacy template asset as deprecated.
src/Asset/PageEntrypoints.php Marks legacy page entrypoints as deprecated and tweaks parent merge logic.
rector.php Updates Rector configuration (paths, php version, composer-based, skips).
phpstan.neon Raises PHPStan level and adjusts analyzed paths.
phpstan-baseline.neon Updates baseline to ignore new LayoutEvent-related unknown-class errors.
contao/dca/tl_layout.php Uses NAME_DEFAULT constant when building the subpalette.
config/services.yml Removes YAML DI configuration.
config/services.php New PHP DI configuration (bindings, service loading, aliases).
composer.json Adds deprecation contracts, broadens dev tool version constraints.
.gitignore Adds .codex and normalizes an entry.
.github/workflows/ci.yml Expands CI triggers and skips jobs for draft PRs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Event/EncoreEnabledEvent.php
Comment thread src/Helper/ConfigurationHelper.php
Comment thread src/Helper/ConfigurationHelper.php Outdated
Comment thread src/EntryPoint/EntryPointsBuilder.php Outdated
Comment thread src/EntryPoint/EntryPointsBuilder.php Outdated
Comment thread src/EventListener/InjectPageEntriesListener.php
Comment thread phpstan-baseline.neon
Comment thread src/Helper/ConfigurationHelper.php
@koertho koertho marked this pull request as ready for review April 20, 2026 12:54
@koertho koertho merged commit 4785053 into v2 Apr 20, 2026
11 checks passed
@koertho koertho deleted the feature/twig_layout_support branch April 20, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants