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.
Hi all.
Im trying to add open graph protocol meta og:image to brilliant gallery images. I have a problem with cache and I'm thinking I did it wrong, so I expose it to community in order to give an idea and take some help. At this moment, sometimes you could see the "meta-tags" in header, but sometimes not.
I'm add in a couple lines in gallery_showtime.inc. Maybe it´s not the correct place to insert this code (line 592):
$result .= drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'property' => 'og:image',
'content' => $imgsrc,
),
), 'node_' . $retval[$poct - 1] . '_og_image');
Any ideas? Can somebody help me and give an option to brilliant gallery users?
Thanks in advance
Comments
Comment #1
drpchris CreditAttribution: drpchris commentedLooks like you've got the call to
drupal_add_html_head()
correct, but the function doesn't return HTML, so you don't want to concat it into the $result string. Maybe just try without the$result .=
in front of it. Not sure where else you could put (other than in therender_brilliant_gallery()
function) if you want to put the image details in the header.Comment #2
ddaniel.gomez CreditAttribution: ddaniel.gomez commentedThank you, drpchris. I´ll test your suggestion. I'm a little bit lost in this task. Hope finally find the solution.
Regards,
Comment #3
ddaniel.gomez CreditAttribution: ddaniel.gomez commentedHi again.
Well, I can't found solution yet. I tested the drpchris' suggestion, but it doesn't work for me.
Hope somebody gives any idea to solve it!
Thanks,