Open geoffroy-noel-ddh opened 5 years ago
Instead of 3 different folders, could we do it with subfolders instead? Something like https://github.com/rkhleics/wagtailmenus/tree/2fee81fd587055de26eab9240f174f344d129b68/wagtailmenus/templates/menus. That way we wouldn't need to repeat all the templates in the 3 different folders.
That's another option, but then the framework selection can't be done with a single constant in local.py, you'd have to explicitly include the templates for your particular framework.
A third options would be to let kdl-wagtail always look into /templates then /template-X (where local.py KDL_WAGTAIL_UI_FRAMEWORK = 'X'). So we don't need to copy templates if they don't need modifications.
Another topic that came up during conversations between GF, BM and GN.
There seem to be 3 possible choices for front-end framework on our research project site:
One idea suggested by BM would be to have three templates folders under each app (e.g. core, people and also bare-bones):
One constant in settings/local.py would determine which framework is used and kdl-wagtail would draw the templates from the relevant folder automatically.
Despite being separate folders, care should be taken to keep the template names and internal structure (e.g. includes, template blocks) compatible between frameworks.
There are risks however of divergence and code duplication. One way would be to have abstract templates above all that, with only the template blocks and context specification. templates-X would inherit from those. But this would create yet another level of abstraction and would probably be too complicated: framework-independent > framework-specific > project-specific .