Using metatag_panels, Panels node template (node/%node) with variants, enabling Metatag configuration..
The values don't get substituted.

I tried:

  • [node:field_cover_image]
  • [node:field-cover-image]
  • %node:field_cover_image
  • %node:field-cover-image

The output I could get was:

  • <meta property="og:image" content="Property 0">
  • nothing at all

The only difference I have with another image field that is working on a panel node is that this one can have multiple (unlimited) values.

PS:

  • I am not using imagecache_tokens
  • I am using File (Field) Paths on that field to put the image file in a specific folder directory

Test here if you want: http://freakydeaky.it/events and click on any event, the top image should be the og:image

Comments

kopeboy created an issue. See original summary.

kopeboy’s picture

Issue summary: View changes
kopeboy’s picture

Issue summary: View changes
kopeboy’s picture

Title: Image fields (og:image) doesn't work with Panels node template » Multiple image fields (og:image) doesn't work with Panels node template
Issue summary: View changes
DamienMcKenna’s picture

Category: Bug report » Support request
Status: Active » Postponed (maintainer needs more info)

It works on this page:

Please let me know the URL of a page that shows the problem.

Also, you should update to a newer version of Metatag :)

kopeboy’s picture

Title: Multiple image fields (og:image) doesn't work with Panels node template » Image fields (og:image) doesn't work with Panels node template
Status: Postponed (maintainer needs more info) » Active

Thanks for the fast reply! I was about to write this indeed!:

  1. I changed the field settings to allow only 1 value
  2. created another node
  3. and the best I could get now is:
  4. <meta property="og:image" content="Property field_cover_image">

If you want to test one that works instead, go to http://freakydeaky.it/format/freaky-deaky
That page is managed by the SAME panel (just another variant), and is using another image field. The metatag configured for og_image in that case is %node:field_logo

Don't know how only one works now .. :/

Yeah I will update shortly, but has anything changed about panels integration?

kopeboy’s picture

Ok I have an hint:

In browser console I got this error:
http://freakydeaky.it/sites/freakydeaky.it/files/styles/medium/public/event…/gallery/13100934_1103727193019155_6244008917168205205_n.jpg?itok=OQZnWAsj Failed to load resource: the server responded with a status of 404 (Not Found)

I guess the problem is related to the image style. I want to use NONE, i.e. the original image. Why does metatag module use the "medium" style?
I don't want to generate extra images if I'm never going to use them, also the bigger the better for facebook. (I already do image resizing on upload).

DamienMcKenna’s picture

Panels is unlikely to change the output of the meta tag values. Might another module be interfering with the token output?

kopeboy’s picture

lol we replied at the exact same moment, see above. I think it's the image style Metatag module is trying to link that doesn't exist.

DamienMcKenna’s picture

Metatag doesn't dictate image styles, the content type's display settings control that. Try adjusting the "default" display option for the content type, see if that works. Alternatively, try overriding the "Token" display mode and customizing the image field's display.

kopeboy’s picture

The problem is that on that content type default view mode I am formatting that image as "Background image" (using bg_image_formatter module) and not the default core "Image".

I'm still using Original image as background, but probably since it doesn't get outputted as <img> in the html Drupal can't tell it's there?!

kopeboy’s picture

And I'm already using the Token view mode to actually display the node somewhere else.. without the image field enabled!

kopeboy’s picture

Status: Active » Closed (fixed)

Yeah you are right. Displaying the image field in the Token view mode of the node make it appear in the metatags (Panels doesn't matter).

I guess I will have to create a new custom view mode so to have the core Token one free for this stuff :(
..or use the Imagecache Token module.

Thanks a lot, you were very fast and on point :)

Are you getting paid for this? You should.

DamienMcKenna’s picture

Glad to be able to help :) (and yes, I get time at work to do contributions :) )