Facebook share pictures

I have integrated facebook share (thanks for the tutorial on oxid site) to my website but when the button share is clicked and a pop up windows opens where you enter your message, select the picture and confirm. In this windows the facebook gives an option to choose a picture and among the choices are pictures takes from the right sidebar where banners are placed.

My question is how do you make the facebook share only offer to choose actual products pictures?

Hello stasysd,

I am afraid you won’t have this option as the facebook API seems to read out all pictures it finds on the complete page.

Regards

There must be a way:

You can control the exact title, description, and thumbnail that Facebook Share uses by adding the following meta tags to the <head> element in your page:

<meta property=“og:title” content=“title” />
<meta property=“og:description” content=“description” />
<meta property=“og:image” content=“thumbnail_image” />

So if you specify the image location like this:
<meta property=“og:image” content=“http://www.propeleris.lt/failai/logo_forum.png” />
then facebook api will open this image and would not give any choice for image selection at all. I have tested it and it works.

So if you point the content parameter ( content=“thumbnail_image” ) to a specific product image with something like this “$product->getLink()”, it should be possible. But a have no clue about php programing so do not know what “function” or whatever it is to use.

Could somebody give me this “missing link” please

Hi,

check this out in your header. Not pretty sure if variable is available in header.tpl:

[{ $oView->getActPicture() }]

Regards

Hi,

I made a feature request out of it because it is interesting for the standard software, isn’t it.

Regards

It does not seem to work. Entire site goes down if I enter this function to the facebook meta tag.

Hi

“function is not accessible” means it is not available by default from header.tpl. You ought to write a getter for it. We get closer :wink:

Regards

[QUOTE=stasysd;42348]It does not seem to work. Entire site goes down if I enter this function to the facebook meta tag.[/QUOTE]

Hi there,
im on the same problem at the moment.

One good, one bad message =)

the good one:
function is not accessible cause of at your startsite is no product defined for getting the picture. you have to add this code to ask for existing product on the given site:

	[{ if $product }]
	<meta property="og:image" content="[{ $oView->getActPicture() }]">
	[{/if}]

the bad one:
on my shop the fix dont seems to work. if i use that meta, the share button still takes the same picture (thrusted shops customer rating) of my site.

Does anybody have an idea, why facebook is still using this picture instead of the given one due to the meta?

Just for complete information:
Facebook dont let me choose any other image … for example productimages … so, when i remove this trusted shops image, facebook choose no picture and disables the function to add any.

Im using the oxid-code which comes with PE 4.4.3
<fb:share-button type=“button”></fb:share-button>

Hi,

I still guess $product is not defined in header so it won’t let you choose the product item picture.

Regards

it is defined for sure … the right url is mentioned in the meta tag but the meta tag itself seems not to be handled by facebook in case of using the oxid provided facebook templates.

stasysd uses normal facebook implementations without the xmlns:fb which seems to handle these metas

by the way … the xmlns:fb in the HTML 4.01 STRICT doctype isn’t valid, so the oxid template isn’t valid since facebook implementation. :wink: