Skip to main content
Added namespace example
Source Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

I didn't know of Twig namespacing just until now. But what always worked for extends and includes is to point to the template you want to extend/include directly, with the path starting from Drupal web root. So in your case it needs to say:

{% extends "core/themes/bartik/templates/block.html.twig" %}

You could also try the following which seems to follow theme inheritance but only up to the final base theme (which would be Classy).

{% extends "@block/block.html.twig" %}

I didn't know of Twig namespacing just until now. But what always worked for extends and includes is to point to the template you want to extend/include directly, with the path starting from Drupal web root. So in your case it needs to say:

{% extends "core/themes/bartik/templates/block.html.twig" %}

I didn't know of Twig namespacing just until now. But what always worked for extends and includes is to point to the template you want to extend/include directly, with the path starting from Drupal web root. So in your case it needs to say:

{% extends "core/themes/bartik/templates/block.html.twig" %}

You could also try the following which seems to follow theme inheritance but only up to the final base theme (which would be Classy).

{% extends "@block/block.html.twig" %}
Mentioned Twig namespaces
Source Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

Extends and include pathsI didn't know of Twig namespacing just until now. But what always start insideworked for extends and includes is to point to the template you want to extend/include directly, with the path starting from Drupal web root. So in your case it needs to say:

{% extends "core/themes/bartik/templates/block.html.twig" %}

Extends and include paths always start inside Drupal web root. So in your case it needs to say:

{% extends "core/themes/bartik/templates/block.html.twig" %}

I didn't know of Twig namespacing just until now. But what always worked for extends and includes is to point to the template you want to extend/include directly, with the path starting from Drupal web root. So in your case it needs to say:

{% extends "core/themes/bartik/templates/block.html.twig" %}
Source Link
leymannx
  • 18.8k
  • 6
  • 72
  • 126

Extends and include paths always start inside Drupal web root. So in your case it needs to say:

{% extends "core/themes/bartik/templates/block.html.twig" %}