OER-WEB-TEAM / design-system--drupal-theme

1 stars 0 forks source link

Twig content path resolves to loaded theme instead of parent theme running the template file #47

Closed AlexVanK closed 5 months ago

AlexVanK commented 5 months ago

It looks like that the content discoverable by inspecting TWIG variables in Drupal is associated to the "active" theme despite the template file being loaded by the parent theme.

image

In the screenshot above, the output comes from a template that lives on the parent theme nihod5, yet it is associated to the subtheme nihod5__subtheme_test.

Is this a bug? Closest issue: https://www.drupal.org/project/drupal/issues/3049414

This is a problem when trying to output a TWIG variable without knowing the active theme name.

AlexVanK commented 5 months ago

Solved by exploiting the {{directory}} issue reported above to construct the proper key to access the array variable properly:

image

Remember to replace "-" with "_" image