When the node page is running through a panel override, the open graph tags don't display.
In order to resolve this, I've had to change the following on line 200 of opengraph_meta.module:
if (NODE_BUILD_NORMAL == $node->build_mode && !$teaser && $page !empty($node->opengraph_meta))
OpenGraphMeta::instance()->render_data($node, $node->opengraph_meta);
to
if (NODE_BUILD_NORMAL == $node->build_mode && !$teaser && !empty($node->opengraph_meta))
OpenGraphMeta::instance()->render_data($node, $node->opengraph_meta);
Not sure why it needs the $page check, but perhaps there is a way to do this without losing that functionality. Could it not just do a direct check that we're actually on the node page (ie arg(0) == node and arg(1) == id)?
Comment | File | Size | Author |
---|---|---|---|
#8 | opengraph_meta_ctools-1214952-8.patch | 781 bytes | cedarm |
Comments
Comment #1
guybedford CreditAttribution: guybedford commentedActually a better fix is to use the following -
if (NODE_BUILD_NORMAL == $node->build_mode && !$teaser && arg(0) == 'node' && !empty($node->opengraph_meta))
Then it only applies to node pages.
Comment #2
haleagar CreditAttribution: haleagar commentedA node can be rendered as NODE_BUILD_NORMAL when it's not the primary node on a node page.
Either called in an embedded view, or more likely pulled from a Node reference on the primary node.
(a slide show, or author profile for instance)
therefore arg(0) == 'node' is not a sufficient check.
In fact using node panels it's quite possible that opengraph_meta_nodeapi is not even called on the primary node, but would be called on other referenced nodes.
Comment #3
yoonchee CreditAttribution: yoonchee commentedAdd this to opengraph_meta.drupal6-hooks.inc
Comment #4
hiddentao CreditAttribution: hiddentao commentedDoes adding #3 (as @yoonchee suggested) work for people? I haven't yet got Panels installed locally.
Comment #5
hiddentao CreditAttribution: hiddentao commentedAppears to be duplicate of #1233570: Meta tags never rendered when using Panels
Comment #6
stijnbe CreditAttribution: stijnbe commented#3 works with node panels.
Comment #7
djhspence CreditAttribution: djhspence commented#3 worked for me too, thanks @yoonchee
Comment #8
cedarm CreditAttribution: cedarm commentedIt does seem that #1233570: Meta tags never rendered when using Panels is a duplicate, but D7 instead of D6. I think that #3 is missing some checks that the D7 patch has. Also, I'm not certain if the foreach in the D7 patch is appropriate or not. We did not include it.
Comment #9
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedWorks great
Comment #10
jemond CreditAttribution: jemond commentedI can confirm the patch #8 works great.
Comment #11
jemond CreditAttribution: jemond commentedAny chance we can get this committed?
Comment #12
torotil CreditAttribution: torotil at more onion commentedHi,
I'm the new maintainer of opengraph_meta. Sorry for the long silence in the issue queue.
Sadly I don't have the resources to care for the Drupal 6 version. Unless and until someone steps up to maintain it I'm therefore closing all D6 issues as WONTFIX.
Feel free to re-open the issue if it is still valid in one of the Drupal 7 branches.
Thanks!