Skip to main content
1 of 2
Ondrej
  • 227
  • 4
  • 15

<title> blank after installing Metatag

I have a theme that uses several template files like page.html.twig, page--title.html.twig, etc.

I installed Metatag to make my website more understandable when sharing links to it via LinkedIn. However, after installing the Metatag module, my tags in all pages except admin are blank. I also tried to specify the title tag's content within Metatag as [current-page:title] | [site:name], but the title tag is still empty

I know this is a common issue. I have found this online

When using custom page template files, e.g., page--front.tpl.php, it is important to ensure that the following code is present in the template file: <?php render($page['content']); ?> or <?php render($page['content']['metatags']); ?>. Without one of these being present the meta tags will not be displayed.

However, that looks like an advice for Drupal 7 only - and I don't know how to do this in a TWIG file used by Drupal 8. Any advice would be appreciated.

Ondrej
  • 227
  • 4
  • 15