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.
There needs to be a way to ignore the front page meta tags and instead use tags loaded e.g. via an entity.
Comment | File | Size | Author |
---|---|---|---|
#11 | 1814736-metatag-check-if-frontpage-disabled.patch | 2.44 KB | Dave Reid |
#9 | 1814736-metatag-check-if-frontpage-disabled.patch | 2.44 KB | Dave Reid |
#7 | metatag-disable_front-1814736-7.patch | 1.29 KB | plach |
#2 | metatag-disable_front-1814736-2.patch | 732 bytes | plach |
Comments
Comment #1
Peacog CreditAttribution: Peacog commentedI have found the handling of front page metatags very confusing, and I when I came across this issue I finally began to understand. For me this feature is very important. Here's my understanding of Global node and Global front page metatags. Please correct me if I'm wrong.
Global Node metatags are default metatags that can be overridden by setting them directly in the node.
The Global: Front page metatags are NOT default metatags and cannot be overridden by setting them in the node (assuming your front page is a node). If you're using a node for your front page, any metatags you set in the node will never be used. If you disable the Global: Front page metatags the system reverts to using Global metatags. If you disable Global metatags, you will get no metatags at all on your front page.
I can think of two situations where it is desirable to ignore the Global metatags and load the tags from the node. The first is in a multilingual website where you have a different front page node for each language. There's a patch (http://drupal.org/node/1282620#comment-6858710) that looks like it will get around that problem by allowing you to translate Global metatags. I've reworked the patch a little so it needs to be reviewed and tested, but it works for me.
The second situation is in a multiple domain site that uses Domain Access, where you have a different front page node for each domain. Currently there does not seem to be any way to set different front page metatags for different domains. There is work ongoing on Domain Meta Tags (see issue here http://drupal.org/node/1399724) but that module is not ready yet.
I hope that's an accurate summary of the situation, and I hope it helps clarify things for anyone who's as confused as I was. Adding the option to ignore Global front page tags, either by just disabling them or by a checkbox setting, would mean that in my case I wouldn't need the multilingual metatags patch or the Domain Meta Tags module.
Comment #2
plachWhat about this?
Comment #3
Peacog CreditAttribution: Peacog commentedThank you! That works perfectly and solves both the multilingual and multiple domains problem in one neat solution.
Comment #4
DamienMcKennaLooks great, a very simple solution, thanks plach!
Once #1798294: Can't edit non-current node revisions is resolved I'll commit this.
Comment #5
Dave ReidI think this might error if the front page configuration is deleted somehow or doesn't return an object, which could be a valid result.
Comment #6
DamienMcKenna@Dave: Good catch.
Comment #7
plachBetter?
Comment #8
aendra CreditAttribution: aendra commentedI can confirm the patch in #7 applies cleanly against 7.x-1.x-dev and resolves the issue. Haven't tried it against the test case in #5.
Comment #9
Dave ReidI think it would just be easier to have a helper function for determining if an instance is enabled since we have to do some of this same logic elsewhere.
Comment #11
Dave ReidTry that again.
Comment #12
Dave ReidTests pass so committing #11 to 7.x-1.x.
http://drupalcode.org/project/metatag.git/commit/140a324