Open grahl opened 7 years ago
Requires changing the Twig Loader to load templates according to these directory patterns:
// Component
${COMPONENT_NAME}/${COMPONENT_NAME}.twig
// Element
${PARENT_COMPONENT_NAME}/elements/${COMPONENT_NAME}.twig
// Component call with other template/variant
${COMPONENT_NAME}/${COMPONENT_NAME_TEMPLATE}.twig
This is required because it is possible that for component templates multiple .twig
files with the same name exist.
E.g. directory structure:
- atoms
- link
- link.twig
- fancy.twig
- text
- text.twig
- fancy.twig
Components should allow to trigger different templates, instead of only one, e.g. searchbox.html.twig (default) searchbox-blue.html.twig (variant)
Possibly related to #2 Related Drupal integration issue: https://github.com/namics/drupal-twig-nitro-bridge/issues/1