Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
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
Comment #1
erlendoos CreditAttribution: erlendoos commentedComment #2
erlendoos CreditAttribution: erlendoos commentedComment #3
erlendoos CreditAttribution: erlendoos commentedI found out! Simply by using "Disable" for the unwanted settings.
Comment #4
erlendoos CreditAttribution: erlendoos commentedComment #5
DamienMcKennaI'm going to change this to a documentation task.
Comment #6
FiNeX CreditAttribution: FiNeX commentedHi, 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.
Comment #7
DamienMcKenna@FiNeX: What is the site frontpage variable set to - the node/123 internal path of the page, or its alias?
Comment #8
FiNeX CreditAttribution: FiNeX commentedThe site frontpage variable is set to the node alias.
Comment #9
DamienMcKennaSee 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)
Comment #10
FiNeX CreditAttribution: FiNeX commented@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.
Comment #11
FiNeX CreditAttribution: FiNeX commentedOn 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.
Comment #12
greenSkin CreditAttribution: greenSkin commentedI'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.
Comment #13
nitrospectide CreditAttribution: nitrospectide commentedI 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.
Comment #14
DamienMcKenna@nitrospectide: A few things to try:
Out of interest, what base theme are you using and do you have a custom tpl file for the front page?
Comment #15
nitrospectide CreditAttribution: nitrospectide commented@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.
Comment #16
DamienMcKenna@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.
Comment #17
nitrospectide CreditAttribution: nitrospectide commented@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?
Comment #18
DamienMcKennaThe "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.
Comment #19
nitrospectide CreditAttribution: nitrospectide commentedOh, OK. Thanks again.
Comment #20
Lazzaro83 CreditAttribution: Lazzaro83 as a volunteer commentedHello!
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!
Comment #21
DamienMcKenna@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.