Description
Partials/helpers directory for theming
Problem
At our company, we have several variations of a core theme for different applications. In general, I have managed to keep the amount of duplicate code in our Git repository to a minimum by using some Terraform magic, but that only goes so far. When it comes to customizing some aspect of a given template for a particular app, we have two choices:
- Multiple complete copies of the file, which may differ by only a few lines
- Pull most of the file's contents out and put the various pieces into parameterized macros in
_helpers.ftl
(akin to using macros like you would use React components or similar)
The second option is the route I would prefer to go down, but our _helpers.ftl
file is already over two thousand lines long. This makes it difficult to maintain, especially if we continue adding large macros for different templates.
Solution
It would be great if, instead of a single _helpers.ftl
file, we could upload an arbitrary number of files under the umbrella of a helpers/*
directory. This would be a huge boost to the developer experience, making it dramatically easier to maintain complex themes or theme families with a lot of highly similar code.
Alternatives/workarounds
As mentioned above, the main workaround for this is to put everything in _helpers.ftl
. It works, but it adds bloat to an already massive file.
Additional context
I believe this would at least partially solve the following feature requests (possibly more):
- Templates: Move the idendity providers onto separated file(s) #1403
- Completely solvable with this change
- Implement parent/child theme relationships #1869
- Similar pain points as mentioned here; indirectly/partially solvable with this change
Community guidelines
All issues filed in this repository must abide by the FusionAuth community guidelines.
How to vote
Please give us a thumbs up or thumbs down as a reaction to help us prioritize this feature. Feel free to comment if you have a particular need or comment on how this feature should work.