Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
New feature: template inheritance #2469
This PR introduces a new feature, the template inheritance. You can now create a new template, and redefine only the required files instead of copying the whole template.
To do so, you have to create in your template directory a template descriptor file, named
The schema is very similar to the modules descriptor. The important element here is
All template files are inherited, including the assets, the translations and the module overrides.
However, you can define specific translations for your template, and use them by declaring a default translation domain in your template files, for example
You can also use your own assets, as in a regular template. Use a
Additionally, you can also override the assets of your parent if you're using the same asset directory structure. For example, if you want to override the
The ParserInterface interface has now 2 new methods :
These methods are useful to temporary set a template (for sending a mail, for example), and then restore the current front or back template.