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.
EDIT: My TWIG files are as follows:
- page.html.twig: https://codeshare.io/5ezppb
- html.html.twig: https://codeshare.io/2KWnnE
- page-title.html.twig: https://codeshare.io/G8XeeD
page.html.twig
andhtml.html.twig
source codes?