Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #2
kopeboy CreditAttribution: kopeboy commentedComment #3
kopeboy CreditAttribution: kopeboy commentedComment #4
kopeboy CreditAttribution: kopeboy commentedComment #5
DamienMcKennaIt 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 :)
Comment #6
kopeboy CreditAttribution: kopeboy commentedThanks for the fast reply! I was about to write this indeed!:
<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?
Comment #7
kopeboy CreditAttribution: kopeboy commentedOk 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).
Comment #8
DamienMcKennaPanels is unlikely to change the output of the meta tag values. Might another module be interfering with the token output?
Comment #9
kopeboy CreditAttribution: kopeboy commentedlol 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.
Comment #10
DamienMcKennaMetatag 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.
Comment #11
kopeboy CreditAttribution: kopeboy commentedThe 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?!Comment #12
kopeboy CreditAttribution: kopeboy commentedAnd I'm already using the Token view mode to actually display the node somewhere else.. without the image field enabled!
Comment #13
kopeboy CreditAttribution: kopeboy commentedYeah 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.
Comment #14
DamienMcKennaGlad to be able to help :) (and yes, I get time at work to do contributions :) )