Hi, i just tested this issue with latest dev versions of ctools, panels and meta tags. There were no results. Global configuration or panel variant config shows fine, but node do not override those configs.

Any help will be appreciated, by now i'm with beta4 in which node lodaded from panels override globals.

Comments

damienmckenna’s picture

Status: Active » Postponed (maintainer needs more info)

Please explain what you are configuring - are you configuring meta tags via the Panels interface and then hoping that the per-node values will override them when displayed using a Panels node_view page?

FAAREIA’s picture

Hi Damien, i'm not using panel config. I'm just using per-node config and it does not override global config.
Every node comes from Pager Manager -> Panel variant with views
I'm using Drupal 7.22

Thanks for your help.

lowfour’s picture

I am having also a lot of troubles displaying per page metatags on nodes that use panel variants. I get the [node:summary] printed out correctly (well, it actually just prints the whole body) but as soon as I write some personalized meta description I get no effect. I just cannot seem to be able to print them out.

I enabled the submodule metatags panels and what I got then was a very nasty error in all pages where their variants had the metatags options activated. I have seen a patch somewhere else.

The whole procedure feels unfinished and unstable. Did someone find a workaround?

thelmer’s picture

Hi Damien

I had the same problem on multilanguage sites.

The function metatag_ctools_render_alter calls metatag_entity_view witch langcode = NULL.
The language is not set later in the process and metatags for translated pages are not found.

I have attached a patch.

damienmckenna’s picture

Status: Postponed (maintainer needs more info) » Needs review

Please test this patch with entities other than nodes - terms, users, etc. A better option might be to use metatag_entity_get_language().

thelmer’s picture

I have now tested with terms and it works fine, but metatags can't be defined for translations if the taxonomy translation are set to "Localize" ( Terms are common for all languages, but only their name and description may be localized )

Tomorrow I'll test for user pages.

FAAREIA’s picture

I tested the patch and it works fine with nodes and taxonomy terms (Translate tested, not Localize).
I have 2 languages, meta tags 1.0-beta7 and drupal 7.17.
Nodes and terms and rendered via Ctools Page manager with variants, each one with different views.
Both custom per-node/term and global meta tags are working in every case.

Thanks for the patch.

lorique’s picture

Status: Needs review » Needs work

I have a problem with this patch.

The problem is that we're looking at the global for "Content language" which will work if the language of the entity is the same as what content language is set to. But what if its not?

Example:
I have a bi-lingual site which has two similar languages used on it, and where the "default" language can be different than the language of the entity being viewed. I add meta config for the entity in language one, but user views it in language 2. The entity is still language 1, but the content language will be language 2. Now default meta tags are used.

I think there is a simple solution to this, which has been overlooked. Use $entity->language instead of the global. This will ensure that its always the entity deciding which language the meta tags are in.

metatag_entity_view($entity, $entity_name, 'full', $entity->language);

Otherwise we can use this http://drupalcontrib.org/api/drupal/contributions!entity!entity.module/f... for doing it. Its possible this is a more robust solution.

louis_sabet’s picture

Seem to be having the same issue here with beta 6 and panels pages.

Defining a node summary for any given node (rendered through panels) seems to produce a meta description, but providing a direct override for the meta description in the node edit form's metadata section doesn't do anything.

The workaround for now is to provide a node summary, but it's not particularly elegant as we want to use that field for node teasers (and the requirements for length and copy style vary between meta description and node teaser).

FWIW, the content type has multi-language disabled, though we do have the locale module enabled, and both en and en_GB defined in the languages config (with en_GB being the default).

damienmckenna’s picture

Component: Code » Panels integration
Issue summary: View changes
damienmckenna’s picture

Version: 7.x-1.0-beta7 » 7.x-1.x-dev
gilgabar’s picture

Status: Needs work » Needs review
StatusFileSize
new621 bytes

Here's an updated patch that implements the suggestion from #5.

cobenash’s picture

#12 works for me

sylus’s picture

I haven't had this problem but am using Entity Translation. However when applying this patch my language no longer worked on the non default language.

4fs’s picture

#12 works for great for me - I have been waiting a fair bit for this fix. THANK YOU.

zwoelfgrad’s picture

#12 works. Thanks

damienmckenna’s picture

Status: Needs review » Closed (duplicate)