× Joomla Facebook Connect support forum

Topic-icon embed og:image in a component

Active Subscriptions:

None
15 years 1 month ago #9789 by evil
hello,
I noticed a strange behaviour with open graph: if i copy/paste the page link into facebook, the correct "first image" appears, but if i click the "button_count" into the same page, a different (and wrong) image is selected as first image.

This happens with eventlist component, what you suggest me to do? Should i embed the "og:image" into eventlist component to show the event image?

With "lint tools" the only OG meta missing are OG IMAGE and OG TYPE. (developers.facebook.com/tools/lint)
I put "type=band" in Social->Open Graf->default so i solved the OG type missing but how to select the correct image in eventlist? should i set a variable into that component?
The topic has been locked.
Support Specialist
15 years 1 month ago #9801 by alzander
In the Eventlist pages, you'll want to include the following tag to specify the image to display for that page. I don't know how to grab the image from Eventlist to use for the current page, but hopefully, there's an easy way to do that. You can add this to the Eventlist template files, or to a module displayed on the Eventlist pages, or any other method that works for you to have this shown on the page.. JFBConnect will translate it into the right OpenGraph tag.
{JFBCGraph image=http://yoursite.com/imagetouse.jpg}

Hope this helps, and good luck!
The topic has been locked.
Active Subscriptions:

None
15 years 1 month ago #9810 by evil
Replied by evil on topic embed og:image in a component
{JFBCGraph image=http://yoursite.com/imagetouse.jpg}

but can i use a variable inside this?
for example into eventlist template code:
{JFBCGraph image=$image}
(of course using the proper variable)
The topic has been locked.
Support Specialist
15 years 1 month ago #9816 by alzander
You can easily have it work with a variable by doing the following, which will echo the variable into the tag. Then, JFBConnect will take care of it from there:
{JFBCGraph image=<?php echo $image; ?>}

You may need to include the URL to your site, depending on how the image variable works. Just open the HTML after you've tried it one way, and make sure the og:image tag is the full path to the image (not a relative link). To do it with the url, it would look like:
{JFBCGraph image=http://yourdomain.com/}

Hope this helps, and good luck!
The topic has been locked.
Active Subscriptions:

None
14 years 10 months ago #11719 by evil
Replied by evil on topic embed og:image in a component
{JFBCGraph image=<?php echo ELOutput::flyer( $this->row, $this->dimage, 'event' ); ?>}

this is the call to the image but if i use with your code it does shows the image again. i'd need only the image url... there right?
The topic has been locked.
Support Specialist
14 years 10 months ago #11729 by alzander
Yes, you want the image URL. Not the full img src=.. tag, if that's what's being output from the call you mention above. If have the specific img tag that's being spit out, we might be able to help you use some PHP to remove the unwanted parts.
The topic has been locked.
Active Subscriptions:

None
14 years 10 months ago #11744 by evil
Replied by evil on topic embed og:image in a component
ok i'm gonna ask first Julien if can tell me how could i call the function into the class

<?php //flyer
echo ELOutput::flyer( $this->row, $this->dimage, 'event' );
?>
i've tried with

<?php //flyer
echo ELOutput::flyer( $filepath , 'event' );
?>
but is not working
The topic has been locked.