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.
I'm going to link to #1468582: Add mobile friendly meta tags to the html.tpl.php to save repetition.
Comment | File | Size | Author |
---|---|---|---|
#1 | bartik-mobile-meta-tags-1488756-1.patch | 2.27 KB | LewisNyman |
Comments
Comment #1
LewisNymanThis patch is based on Dan's patch in #1468582: Add mobile friendly meta tags to the html.tpl.php
Comment #2
switzernThis patch has been tested and it looks to working correctly. Tested on desktop, iOS and Android browser.
Comment #3
catchI'm not sure about putting these in hook_html_head_alter(). That primarily exists for altering existing tags, not for adding new ones.
Seems like they could also be added in hook_page_alter() using #attached, which runs a lot earlier. Or what about hook_preprocess_html()?
I'm moving this back to CNR rather than code needs work - I'm not sure the best place for this to live, especially considering this will likely be done in all core themes (which presumably contrib themes will be expected to follow) it'd be good to understand why more.
Comment #4
JohnAlbinThanks, Catch! Your comment kicked off a new discussion about how to do this in the best way for themers and module devs. It's a compromise, but a good one.
I'm closing this in favor of a unified approach in #1468582: Add mobile friendly meta tags to the html.tpl.php