Skip to content

Add ability to overwrite templates multiple times using templateFolder - #1835

Merged
lahma merged 1 commit into
RicoSuter:masterfrom
Georgy-Losenkov:overwrite-templates-multiple-times
Jul 11, 2025
Merged

Add ability to overwrite templates multiple times using templateFolder#1835
lahma merged 1 commit into
RicoSuter:masterfrom
Georgy-Losenkov:overwrite-templates-multiple-times

Conversation

@Georgy-Losenkov

Copy link
Copy Markdown
Contributor

For most of imports I am using one set of templates. But for some services I need to change templates slightly.
In order to avoid keeping full copy of templates, I proppose to use multiple template directories. So template factory will try to find template in the first directory, than in the second directory and so on until it comes to the default templates.
To fulfil this without changing settings I propose to split templateDirectory by semicolon (;) and to use nonempty parts as pathes to template directories.

Existing settings will be affected if template directory path contains semicolon. That seems to be very rare case, that can be easily fixed.

@lahma lahma left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Seems reasonable and non-breaking. thanks for the PR!

@lahma
lahma merged commit 277ca0d into RicoSuter:master Jul 11, 2025
2 checks passed
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