There needs to be a way to ignore the front page meta tags and instead use tags loaded e.g. via an entity.

Files: 
CommentFileSizeAuthor
#11 1814736-metatag-check-if-frontpage-disabled.patch2.44 KBDave Reid
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#9 1814736-metatag-check-if-frontpage-disabled.patch2.44 KBDave Reid
FAILED: [[SimpleTest]]: [MySQL] 7 pass(es), 4 fail(s), and 0 exception(s).
[ View ]
#7 metatag-disable_front-1814736-7.patch1.29 KBplach
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]
#2 metatag-disable_front-1814736-2.patch732 bytesplach
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Comments

I 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.

Status:Active» Needs review
StatusFileSize
new732 bytes
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

What about this?

Thank you! That works perfectly and solves both the multilingual and multiple domains problem in one neat solution.

Status:Needs review» Reviewed & tested by the community

Looks great, a very simple solution, thanks plach!

Once #1798294: Can't edit non-current node revisions is resolved I'll commit this.

I think this might error if the front page configuration is deleted somehow or doesn't return an object, which could be a valid result.

Status:Reviewed & tested by the community» Needs work

@Dave: Good catch.

Status:Needs work» Needs review
StatusFileSize
new1.29 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Better?

I 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.

StatusFileSize
new2.44 KB
FAILED: [[SimpleTest]]: [MySQL] 7 pass(es), 4 fail(s), and 0 exception(s).
[ View ]

I 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.

Status:Needs review» Needs work

The last submitted patch, 1814736-metatag-check-if-frontpage-disabled.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new2.44 KB
PASSED: [[SimpleTest]]: [MySQL] 11 pass(es).
[ View ]

Try that again.

Status:Needs review» Fixed

Tests pass so committing #11 to 7.x-1.x.
http://drupalcode.org/project/metatag.git/commit/140a324

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.