If I define a node as front page - so that editors change the front page from the front page, easier to explain etc...

From an editors perspective one would expect that changes to the metatag setup have effect. However... at the front page the settings from the node are ignored.

Is there a way to make metatag look for the setup in the node for the front page?

Comments

erlendoos’s picture

Issue summary: View changes
erlendoos’s picture

Issue summary: View changes
erlendoos’s picture

I found out! Simply by using "Disable" for the unwanted settings.

erlendoos’s picture

Status: Active » Closed (works as designed)
DamienMcKenna’s picture

Component: User interface » Documentation
Category: Support request » Task
Status: Closed (works as designed) » Active
Issue tags: -user experience

I'm going to change this to a documentation task.

FiNeX’s picture

Hi, disabling the "Global: Front page" settings is not a valid solution on the following use case:

If the front page is set to a specific node, the title, the description and many other meta tags will be fine, but canonical and shortlink will be the alias and "node/NID" of the node.

This behaviour is not correct on the front page where both should refers to the front page url (which is different from the url of the node used as front page).

Currently I've developed a custom module to specifically set the front page title and description because I don't want to give meta tags administration permissions to my users.

What do you think about this situation?

Thanks.

DamienMcKenna’s picture

@FiNeX: What is the site frontpage variable set to - the node/123 internal path of the page, or its alias?

FiNeX’s picture

The site frontpage variable is set to the node alias.

DamienMcKenna’s picture

See if it works if you change it to the node/123 value. Also, you might need to use GlobalRedirect to make Drupal change links for that node to the homepage, that's really a Drupal thing and not a metatag thing.

(note to self: add a note in the docs about it)

FiNeX’s picture

@Damien: if I set the front page variable to node/123, the value is always replaced with the aliased path, it doesn't depend on global redirect.
Moreover enabling or disabling global redirect doesn't affect the situation described before :-(

N.B: I've always cleared cache between the tests.

FiNeX’s picture

On my specific case the global "page title" has been configured with the default "[current-page:title] | [site:name]" and meta description is empty. Front page settings inherits meta tags from Global and the node set as front page has it's custom data. At this point I suspect that when Metatag builds the meta tags on front page, it doesn't correctly merge the settings.

More precisely, being the "Global: Front page" settings empty, Metatag assumes that "Global" settings needs to be used, ignoring the meta tags on the node.

greenSkin’s picture

I'm very much interested in a solution as well. It does make sense to have the front page inherit the node's metatags when a node is set as the front page.

nitrospectide’s picture

I seem to be having the same/very similar issue.

My Drupal 7 site is running Metatag, which appears to work perfectly on all pages but the front page. Basically, whenever something is the front page, no page title settings work, and the only page title I ever get follows the [page name] | [site name] formula. If I stop that node from being the front page, the page title works as expected. I have tried:

- Overriding the page title in the Metatag tab in the node. This works if the node is no longer the front page. When it's the front page, it reverts back to the default mentioned above.

- Overriding the page title at the Global: Front Page settings. This produces no effect.

- Disabling the Global: Front Page settings so that they are no longer active. This also produces no effect.

My html.tpl.php file has this in it for the page title: print $head_title;

Am I doing something incorrectly? Is this a bug? It sounds like erlendoos got this to work, but I am at a loss.

DamienMcKenna’s picture

Category: Task » Support request

@nitrospectide: A few things to try:

  • On the Settings page, under Advanced Settings change the "Page region to use" to something else to see if you can make it work.
  • Check your theme's settings to see if there's an option that says something like "do not render content region on the front page". The Omega theme has an option like that which is enabled by default, i.e. by default it won't output the normal meta tags for the front page.

Out of interest, what base theme are you using and do you have a custom tpl file for the front page?

nitrospectide’s picture

@DamienMcKenna: First, let me say thank you for such a quick response! I really appreciate your help.

Your first suggestion did the trick. It now works beautifully!

To your second point (though I guess this is moot), I am using a custom framework in which there is a page--front.tpl.php. The way I build all of my homepages is that they don't use the body field, but are built out of an assemblage of blocks. This is why the module was failing to trigger and generate the metatags.

Out of curiosity, why does the module look for the presence of a region to render the Metatag info? I'm having trouble envisioning a scenario in which the absence of a region would make me want the page to not render Metatag info.

DamienMcKenna’s picture

@nitrospectide: It was an architectural decision to work off hook_page_build and add the variables to the 'content' region, but not every page has a 'content' region. We might have to change it, now that we can do so easily.

nitrospectide’s picture

@DamienMcKenna: OK. Gotcha.

On normal content pages, If I have "X" set as the page title in the Global Settings, and then override in the page title field on the individual node with "Y", the page title at render is "y". Following this same pattern with the front page, the rendered page title picks up the Global setting and is rendered as "X". I have to disable the global setting to get the node-level setting to take effect. Why is that?

DamienMcKenna’s picture

The "Global:Front Page" configuration is checked before the current node is checked. This was done because the front page usually has different configuration requirements than a normal node, so it was necessary to provide an option of managing them separately.

nitrospectide’s picture

Oh, OK. Thanks again.

Lazzaro83’s picture

Hello!
I read the whole conversation here and especially between Damien and nitrospectide.
What I do not manege to find is what Damien was talking about when he said "On the Settings page, under Advanced Settings change the "Page region to use" to something else to see if you can make it work."

I do not seem to understand on what does the Settings page refers to and am not able to find Advanced settings nor Page region to use.

Could someone please help me by explaining to me where to find this or by posting jpg here...

Thanx in advance!

DamienMcKenna’s picture

@Lazaaro83: Go to the "Configuration" item in the menus, then go to the "Metatags" page (it's listed in the "Search and Metadata" section of the "Configuration" page), then go to the "Settings" tab, and click "Advanced settings" to expand out the fieldset, and change the "Page region to use" to something else, e.g. "Footer", and click the "Save" button.