- Posts: 8743
COMMUNITY FORUM
Facebook Share returning Blank Thumbnail
- Lefteris
- Offline
- Moderator
Less
More
12 years 2 weeks ago #100974
by Lefteris
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Lefteris on topic Re: Facebook Share returning Blank Thumbnail
@Lul Blaka
Have you read the documentation? Take a read at getk2.org/documentation/tutorials/item/174-templating-with-k2-and-the-concepts-of-sub-templates
Have you read the documentation? Take a read at getk2.org/documentation/tutorials/item/174-templating-with-k2-and-the-concepts-of-sub-templates
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- George Savvoglou
- Offline
- New Member
Less
More
- Posts: 11
12 years 1 week ago #100975
by George Savvoglou
Replied by George Savvoglou on topic Re: Facebook Share returning Blank Thumbnail
A think this code works!!!
But the tumbnail at facebook is very small!! can i change this for a little bit bigger image?? :)
But the tumbnail at facebook is very small!! can i change this for a little bit bigger image?? :)
Kannan Naidu wrote: I'm using this for now and works like a charm too :D. Thanks Lefteris Kavadas for the facebook image code.
Log in or Create an account to join the conversation.
- Lefteris
- Offline
- Moderator
Less
More
- Posts: 8743
12 years 1 week ago #100976
by Lefteris
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Lefteris on topic Re: Facebook Share returning Blank Thumbnail
@George Savvoglou
If you have hardcoded the image then it depends on the image. Otherwise go to K2 paramters and select the desired width for the Facebook image.
If you have hardcoded the image then it depends on the image. Otherwise go to K2 paramters and select the desired width for the Facebook image.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- nodun
- Offline
- New Member
Less
More
- Posts: 1
12 years 4 days ago #100977
by nodun
Replied by nodun on topic Re: Facebook Share returning Blank Thumbnail
I have similar issue but describen steps are not working for me.
Somewhere in code my domain is doubling for og:image and generate code in single articles like:
<meta property="og:image" content="xtri.pl/http://xtri.pl/cache/multithumb_thumbs/b_500_450_16777215_00___images_Lunarglide4_DSC_0099.JPG">
you can check it on:
xtri.pl/sprzet/testy/item/243-test-nike-lunarglide4
Do you guys have any idea how to repair this issue?
Somewhere in code my domain is doubling for og:image and generate code in single articles like:
<meta property="og:image" content="xtri.pl/http://xtri.pl/cache/multithumb_thumbs/b_500_450_16777215_00___images_Lunarglide4_DSC_0099.JPG">
you can check it on:
xtri.pl/sprzet/testy/item/243-test-nike-lunarglide4
Do you guys have any idea how to repair this issue?
Please Log in or Create an account to join the conversation.
- Lefteris
- Offline
- Moderator
Less
More
- Posts: 8743
12 years 4 days ago #100978
by Lefteris
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Lefteris on topic Re: Facebook Share returning Blank Thumbnail
@nodun
We have added the og:image tag to K2 2.6 Beta version. So if you are using an earlier version the tag is not coming from K2. You need to search your templates and plugins for code that is generating.
We have added the og:image tag to K2 2.6 Beta version. So if you are using an earlier version the tag is not coming from K2. You need to search your templates and plugins for code that is generating.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Lul Blaka
- Offline
- New Member
Less
More
- Posts: 2
11 years 11 months ago #100979
by Lul Blaka
Replied by Lul Blaka on topic Re: Facebook Share returning Blank Thumbnail
i have readed the documents,,, and then overided the files, as the manual said
pls help me, where should i put the code, in which part of item,php,,, and which code exactely (because here I c many codes)
please someone help me share my k2 items on fb
pls help me, where should i put the code, in which part of item,php,,, and which code exactely (because here I c many codes)
please someone help me share my k2 items on fb
Please Log in or Create an account to join the conversation.
- Goh Yew Hoe
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 11 months ago - 11 years 11 months ago #100980
by Goh Yew Hoe
Replied by Goh Yew Hoe on topic Re: Facebook Share returning Blank Thumbnail
Hmm.. depending on your template the file could be in a different folder, but it should be something like com_k2\template_name\item.php You can put the code near the top of the file, say after line 17.
Anyway, for anyone still looking to use this code, I have modified it to be as dynamic as possible so the field values are pulled from joomla instead of a static value. Note: Make sure you check the 2nd logo path though, it's picking logo.jpg from the root image folder but you can change it yourself to read from any folder or file.
Anyway, for anyone still looking to use this code, I have modified it to be as dynamic as possible so the field values are pulled from joomla instead of a static value. Note: Make sure you check the 2nd logo path though, it's picking logo.jpg from the root image folder but you can change it yourself to read from any folder or file.
<?php
$fbog =& JFactory::getDocument();
$app = JFactory::getApplication();
$facebookImage = 'image1'.$this->item->params->get('facebookImage','Small');
$opengraph_meta = '
<meta property="og:title" content="'.$this->item->title.'"/>
<meta property="og:type" content="article"/>
<meta property="og:url" content="'.substr(JURI::root(),0,-1).str_replace(JURI::root(true),'',$this->item->link).'"/>
<meta property="og:site_name" content="'.$app->getCfg( 'sitename' ).'"/>
';
if (!empty($this->item->$facebookImage)) {
$opengraph_meta .= '<meta property="og:image" content="'.substr(JURI::root(),0,-1).str_replace(JURI::root(true),'',$this->item->$facebookImage).'" />';
}
else {
$opengraph_meta .= '<meta property="og:image" content="'.substr(JURI::root(),0,-1).'/images/logo.jpg"/>';
}
$fbog->addCustomTag( $opengraph_meta );
?>
Please Log in or Create an account to join the conversation.
- Kannan Naidu Venugopal
- Offline
- Platinum Member
- Aham Brahmasmi
11 years 11 months ago #100981
by Kannan Naidu Venugopal
K2 Rocks \m/
Replied by Kannan Naidu Venugopal on topic Re: Facebook Share returning Blank Thumbnail
The path should be /templates/YOURJOOMLATEMPLATE/html/com_k2/
It's better to upgrade to K2 2.6.x (latest version) as it already comes with OGP meta tags.
It's better to upgrade to K2 2.6.x (latest version) as it already comes with OGP meta tags.
K2 Rocks \m/
Please Log in or Create an account to join the conversation.
- Goh Yew Hoe
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 39
11 years 11 months ago #100982
by Goh Yew Hoe
Replied by Goh Yew Hoe on topic Re: Facebook Share returning Blank Thumbnail
I just updated to 2.6.1 to test the OG support and it seems the og tags are defined wrongly.
For example, it's defined as this at the moment.
That's wrong, it should be
So technically speaking, the og tags in K2 at the moment aren't working. Now to figure how to disable those faulty tags in K2...
For example, it's defined as this at the moment.
<meta name="og:type" content="Article" />
That's wrong, it should be
<meta property="og:type" content="Article" />
So technically speaking, the og tags in K2 at the moment aren't working. Now to figure how to disable those faulty tags in K2...
Please Log in or Create an account to join the conversation.
- dilemtl
- Offline
- New Member
Less
More
- Posts: 5
11 years 11 months ago #100983
by dilemtl
Replied by dilemtl on topic Re: Facebook Share returning Blank Thumbnail
Stephen wrote: in item.php
Log in or Create an account to join the conversation.