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.
It is essential that Meta tags works out-of-the-box with Drupal core.
The following scenarios do not currently work (20120801).
Scenario #1: Node page:
- Drupal 7.15, Metatag (current -dev), Token 1.1, CTools 1.0.
- Install the above from a custom installation profile.
- Upon installation, create a new content type with all default settings.
- Create a new node of this content type, manually fill in a description meta tag.
- Load the node page - the overridden meta tag does not show.
Scenario #2: Front page:
- Drupal 7.15, Metatag (current -dev), Token 1.1, CTools 1.0.
- Install the above from a custom installation profile.
- Upon installation, go to admin/config/search/metatags/config/global%3Afrontpage and hardcode a new description value.
- Go to the homepage - the overridden meta tag does not show.
FYI the output was recently changed in #1363476: Panels integration - ensure meta tags work OOTB on entity pages to work off hook_entity_view rather than hook_field_attach_view_alter(). I personally believe this is the correct approach, but clearly something isn't quite right.
Comment | File | Size | Author |
---|---|---|---|
#1 | metatag-n1708718.patch | 1.73 KB | DamienMcKenna |
Comments
Comment #0.0
DamienMcKennaLinked to #1284852.
Comment #0.1
DamienMcKennaSeparated out the issue into two scenarios.
Comment #1
DamienMcKennaThis appears to resolve scenario #1.
Comment #2
DamienMcKennaThinking on it further, it feels like the caching engine used on hook_page_build() doesn't seem to work, which is why the front page meta tag isn't working.
Comment #3
DamienMcKennaI committed the patch above, it does at least guarantee that meta tags are output on entity object pages that have hook_entity_view() support.
I re-ran the same tests on a clean install of D7, CTools 1.0, Token 1.1 and the current Metatag codebase and the homepage tags work.
Lets continue this in other issues as needed.
Comment #4
plopescHello
Metatag module dev release downloaded last week worked well for me. However, after upgrading to 7.x-1.0-beta7 title tag does not work for custom node pages.
I've done
git checkout 37e1bd2
and it works fine for me now again. Some of the changes included last weekend broke the title tag behavior.Regards
Comment #5
rbrownellI can confirm that this is working for non-customized node pages. It however is not working for pages that are customized using panels. Customized nodes that use panels resort to the Global Default settings. (At least for Open Graph meta tags.) Should this be posted as a separate issue or is there already an issue for this?
Comment #6
DamienMcKenna@nfd: Please follow #1363476: Panels integration - ensure meta tags work OOTB on entity pages for details of the Panels integration. Thanks.
Comment #7
DamienMcKennaUser entities work.
Test scenario for user defaults:
Test scenario for user object overrides:
Comment #8
DamienMcKennaTerm pages via taxonomy_term_page()... they really need #1067120: Missing hook_taxonomy_term_view() or hook_entity_view() when viewing a term (patch from comment #73 was used for these tests)!
Test scenario for term defaults without the patch:
Test scenario for term defaults with the patch:
Test scenario for term overrides with the patch:
Comment #9
standingtall CreditAttribution: standingtall commentedThanks everyone .. Really desperate to see this working.
Comment #10
pyxio CreditAttribution: pyxio commentedI am having serious issues with metatags as well. For me, only global settings seem to work. I can't get overrides or page specific meta tags to work. Has this patch been incorporated into the dev version yet? I tried the dev version and seem to have the same problems. Cheers, Kevin
Comment #11
DamienMcKennaPlease help test #1784896: Overriding meta tags fall back to parent default tag value and #1700160: Support taxonomy term pages until taxonomy supports hook_entity_view(), they may resolve a lot of the problems we're currently having.
Comment #12
DamienMcKennaThe remaining item is #1662668: Support forum pages until forums supports hook_entity_view().
Comment #13
DamienMcKennaComment #14
remkovdz CreditAttribution: remkovdz commentedI've read somewhere else that the frontpage-problem should be fixed, but I just installed beta7 and it still doesn't work (no meta tags showing up on frontpage). Is this still a known issue or should it indeed be fixed?
Comment #15
DamienMcKenna@remkovdz: Please take a look at the README.txt file included with the module and try some of the troubleshooting tips.
Comment #16
DamienMcKennaAm marking this resolved as all core entities work correctly out of the box as of beta5 (really much earlier, but there were bugs in beta4 that caused problems).
There are some one-off pages that may require further work, but at the very least Metatag:Context can be used as a work-around.
Comment #17
remkovdz CreditAttribution: remkovdz commentedThanks Damien, readme.txt was helpfull.
Comment #18.0
(not verified) CreditAttribution: commentedCorrected the link to the other issue, it was really #1363476.
Comment #19
DamienMcKenna