PDA

View Full Version : Facebook thumbnail tip!



Peter Jonsson
December 7, 2012, 09:22 PM
Hey!

Thought i would share this to you for people that uses facebook.
If you have ever shared a listing on facebook and have the same problem as i did, that facebook would use alot images(i had 17-22images different images on from first page).
It was slow and annoying.

I found a great fix for it!

We will use 1 standard image (if you want that) for the startpage. This way it wont look thru all the listings. Saves the time and you have the ability
to decide what image you want to have for your site.

If you link a listing on facebook and you have lets say the banner plugin on the sidebar with some ads in it facebook will see them to even if they arent related to the listing.

If you add this to your website facebook will only see 2 images. The "standard" picture and the main picture in the listing.

Be sure you check what image setting you have, if you have PreviewBox or LightBox

PreviewBox
-templates/<your template>/tpl/header.tpl
Find


<meta name="Keywords" content="{$pageInfo.meta_keywords}" />


Add this code under the code above


<meta property="og:image" content="{$smarty.const.RL_URL_HOME}files/{$photos.0.Photo}"/>



LightBox
-templates/<your template>/tpl/header.tpl
Find


<meta name="Keywords" content="{$pageInfo.meta_keywords}" />


Add this code under the code above


<meta property="og:image" content="{$smarty.const.RL_URL_HOME}files/{$photo.Photo}"/>

Wei Hong
June 12, 2014, 10:24 PM
Hi, I have tried the solution but it didn't work. When I link my homepage says: www.domain.com, it show thumbnail of listings on the homepage, is there anyway if I can make it shows the logo when link homepage www.domain.com ?

Thanks

Viktor
June 13, 2014, 05:22 AM
Hello Wei,

You can create condition on file hrader.tpl for line:


<meta property="og:image" content="{$smarty.const.RL_URL_HOME}files/{$photos.0.Photo}"/>

use this code:



{if $pageInfo.Controller == 'listing_details'}
<meta property="og:image" content="{$smarty.const.RL_URL_HOME}files/{$photos.0.Photo}" />
{else}
<meta property="og:image" content="{$rlTplBase}img/logo.png" />
{/if}


but if you want to use logo only for home page you should use:



{if $pageInfo.Controller == 'home'}
<meta property="og:image" content="{$rlTplBase}img/logo.png" />
{else}
<meta property="og:image" content="{$smarty.const.RL_URL_HOME}files/{$photos.0.Photo}" />
{/if}


save and check again.

Wei Hong
June 13, 2014, 05:46 AM
Hi Viktor,

I added the following code in header.tpl file
Clear cache and everything, add my page www.domain.com in my facebook and it still show 3 pictures of the listings shown on my hompage from recent listings box.

Found this line in my header.tpl


<meta name="Keywords" content="{$pageInfo.meta_keywords|strip_tags}" />

Then I add the following code below that line:


<meta property="og:image" content="{$smarty.const.RL_URL_HOME}files/{$photos.0.Photo}"/>
{if $pageInfo.Controller == 'home'}
<meta property="og:image" content="{$rlTplBase}img/logo.png" />
{else}
<meta property="og:image" content="{$smarty.const.RL_URL_HOME}files/{$photos.0.Photo}" />
{/if}

Did i do any thing wrong?

Viktor
June 13, 2014, 06:19 AM
Hello Wei,

Would you please send me your site name (if you don't want to publish it send to my PM)

Chysostomos Floros
November 25, 2020, 07:35 PM
Hi there.... When i sent link of my site for logo is the english flag...or nothing...
How can i change with the logo of my site? at header.tpl i cannot find Viktor's code as show above.

Rudi
November 25, 2020, 08:37 PM
Make sure that your logo is located in templates > img > logo.png