Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: better templates handling #1835

Merged
merged 11 commits into from
Nov 14, 2023
Merged

feat: better templates handling #1835

merged 11 commits into from
Nov 14, 2023

Conversation

ArnaudLigny
Copy link
Member

@ArnaudLigny ArnaudLigny commented Nov 12, 2023

Breaking change

All internal templates have been moved from layouts to _default/layouts.

So maybe you should change the way you extend templates, for example:

{% extends ['page.html.twig', '_default/page.html.twig'] %}

New lookup rules

homepage

New alias home on top of index:

  • home.<format>.twig
  • _default/home.<format>.twig

page

Custom templates can now be stored in _default (useful for themes):

  • _default/<layout>.<format>.twig

section

  • <section>/index.<format>.twig

Localization

Language added to lookup: layouts/(<section>/)<type>|<layout>.<format>(.<language>).twig.

@ArnaudLigny ArnaudLigny marked this pull request as ready for review November 12, 2023 22:59
@ArnaudLigny ArnaudLigny merged commit 57605b0 into master Nov 14, 2023
20 checks passed
@ArnaudLigny ArnaudLigny deleted the layouts branch November 14, 2023 11:42
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.

1 participant