Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
All settings working as expected apart from the Page Title. It seems this is always ignored. Even setting to a static value is ignored. It will always output the default. I have tried setting in Global all the way through to 'by path' trying to see if it was I using incorrectly.
I have seen other issues mentioning this but they appear to have been patched or addressed.
I DID previously have the page title module installed but I removed and deleted before installing Metatags.
Any suggestions?
Comments
Comment #1
cyxair CreditAttribution: cyxair commentedI just ran into the same problem.
Fixed it by adding the following code to a hook_preprocess_html in my theme template.php file :
I left this issue open, as I don't think this kind of trick should be necessary to use this module.
Comment #2
Dave ReidMetatag should work out of the box with all core themes. What theme are you using? Maybe something else is a bit more non-standard elsewhere in the code?
Comment #3
cyxair CreditAttribution: cyxair commentedMy theme is form Bartik.
I didn't see anything particular in template.php
While printing the $variables array in hook_preprocess_html(), I found out that the title generated by Metatag module was in $variables['head_array']['title'], and html.tpl.php was printing $variables['head_title'], so I came up with this piece of code to make it work.
Comment #4
serg2 CreditAttribution: serg2 commentedI am using the Omega theme, version 4.
I queried the title settings earlier with the maintainer/creator of the theme and he said the title was set in the standard way: https://drupal.org/node/2126363
Would you like me to provide anything to figure this out or would you just suggest I use cyxairs solution(https://drupal.org/comment/8143383#comment-8143383)?
thanks
Comment #5
nlhnam CreditAttribution: nlhnam commented@cyxair: Your array not work in my code.
I have to put this: $variables['page']['content']['content']['content']['metatags']['global']['title']['#attached']['metatag_set_preprocess_variable'][0][2];
Comment #6
DamienMcKennaSince v7.x-1.5 it has been possible to select with theme region is used to trigger the meta tag output, so this should no longer be an issue.