Page 1 of 1

[Guide] Facebook Open Graph Images

Posted: 16 Mar 2013, 13:35
by kemin
Hi, these are my instructions to add tags og:image with the first 10 images of the category in categories view and the image in comments view.

In components\com_phocagallery\views\category\tmpl\default_images.php

Add after

Code: Select all

// IMG Start

				if ($extImage) {

					echo JHtml::_( 'image', $value->extm, $value->altvalue, array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height'], 'class' => 'pg-image'));

				} else {
thise code

Code: Select all

if ($key<10) {
		$this->document->addCustomTag('<meta property="og:image" content="http://www.SITENAME.EXT/images/phocagallery/'.$value->filename.'"/>');
					}
Then in components\com_phocagallery\views\comment\view.html.php

add after

Code: Select all

$item->linkthumbnailpath	= PhocaGalleryImageFront::displayCategoryImageOrNoImage($item->filenameno, 'large');
this

Code: Select all

$this->document->addCustomTag('<meta property="og:image" content="http://www.SITENAME.EXT/images/phocagallery/'.$item->filenameno.'"/>');
Now you can share your categories or your images on Facebook with correct og:image.

I hope to be helpful.
Kemin

Re: [Guide] Facebook Open Graph Images

Posted: 21 Mar 2013, 01:07
by Jan
Hi, thank you for this guide.

Jan

Re: [Guide] Facebook Open Graph Images

Posted: 21 Aug 2013, 23:35
by vedante
Hi! I have a problem when i use Picasa galleries.
on cooment view, when i post a coment - wrong thumbnail is displayed in facebook. :cry:
When i share the Url on facebook. It shows the right thumbnail.

Is the fact that i use Picasa galleries is matters?
If yes, what should be the code for right Picasa og:image ?

Thank you in advance!

(Also i want to thank the developer for greatest component for joomla ever!)

Re: [Guide] Facebook Open Graph Images

Posted: 23 Aug 2013, 17:03
by Jan
Hi, depends on used site, see if the comment has own page (not popup window) then it should be set this site :idea:

Jan

Re: [Guide] Facebook Open Graph Images

Posted: 27 Aug 2013, 06:15
by vedante
Hi! Thanks for the respons,
This is an examle for comment view of a picture on my site:
http://www.inoe.tv/galereya/220-best-pi ... -aviv2-jpg
Any help will be appriciated. (sorry for posting URL)

Re: [Guide] Facebook Open Graph Images

Posted: 29 Aug 2013, 16:35
by Jan
Hi, I see, the site is Ok, so then only idea is to ask facebook developers, why the post, etc. does not take the displayed image there :idea: