- Posts: 87
COMMUNITY FORUM
Item Image as Facebook sharing thumbnail
- bkemler
-
Topic Author
- Offline
- Premium Member
width divided by height (w/h, h/w) cannot exceed 3.0. For example, an
image of 126x39 pixels will not be displayed, as the ratio of width
divided by height is greater than 3.0 (126/39 = 3.23). Images will be
resized proportionally."
Please Log in or Create an account to join the conversation.
- kire timov
-
- Offline
- Senior Member
- Posts: 59
thanks for your effort
Please Log in or Create an account to join the conversation.
- kire timov
-
- Offline
- Senior Member
- Posts: 59
Please Log in or Create an account to join the conversation.
- bkemler
-
Topic Author
- Offline
- Premium Member
- Posts: 87
Hmmm.... it works on my site. www.homewardtrails.org
How good is your level of knowledge of PHP? When you say "just after the //set metadata", you didn't put it on the same line as that and therefore comment it out, did you?
Please Log in or Create an account to join the conversation.
- kire timov
-
- Offline
- Senior Member
- Posts: 59
Please Log in or Create an account to join the conversation.
- kire timov
-
- Offline
- Senior Member
- Posts: 59
Please Log in or Create an account to join the conversation.
- bkemler
-
Topic Author
- Offline
- Premium Member
- Posts: 87
Another thing that's probably obvious but worth checking... you're looking at a page that's an item view, right? This fix doesn't do anything for a page that shows a category view, tag view, etc.
Beyond that, all I can tell you is the process of elimination that I would use. First I would go to a K2 item view and see if the link rel=image_src tag is showing up in the head tag at all. If so, then there must be a problem with what's in the tag if it's not working so you need to mess around with that part of it. If not, then there must be a problem with the if statement or with the addCustomTag so you need to mess around with that... like maybe copying and pasting from the forum messed up a character or something.
Please Log in or Create an account to join the conversation.
- kire timov
-
- Offline
- Senior Member
- Posts: 59
note: and yes we are talking about IN itemView
B Kemler said:kire timov said:any ideas?
Another thing that's probably obvious but worth checking... you're looking at a page that's an item view, right? This fix doesn't do anything for a page that shows a category view, tag view, etc.
Beyond that, all I can tell you is the process of elimination that I would use. First I would go to a K2 item view and see if the link rel=image_src tag is showing up in the head tag at all. If so, then there must be a problem with what's in the tag if it's not working so you need to mess around with that part of it. If not, then there must be a problem with the if statement or with the addCustomTag so you need to mess around with that... like maybe copying and pasting from the forum messed up a character or something.
Please Log in or Create an account to join the conversation.
- bkemler
-
Topic Author
- Offline
- Premium Member
- Posts: 87
Did you check to see if the head tag of the page contained a link rel=image_src tag? Checking that doesn't require PHP knowledge.
Please Log in or Create an account to join the conversation.
- Jimmy P
-
- Offline
- New Member
- Posts: 4
if (JFile::exists(JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.md5("Image".$item->id).'_XS.jpg')) { $document->addCustomTag('<link rel="image_src" href="'.JURI::root().'media/k2/items/cache/'.md5("Image".$item->id).'_XS.jpg">');
} I'm replying only because someone might find it useful in the future
Please Log in or Create an account to join the conversation.
- Jiliko.net
-
- Offline
- Platinum Member
- Posts: 567
Thanks for sharing this...very useful.
Olivier
Please Log in or Create an account to join the conversation.
- Olivier Karfis
-
- Offline
- Elite Member
Been using it in production for a couple of weeks now and it's awesome!
--Olivier
Olivier Nolbert said:
Hi,
Thanks for sharing this...very useful.
Olivier
Owner of www.FrenchToday.com - K2 fan and freelancer, runs the Joomla/K2 tip site: www.yanaku.com
Please Log in or Create an account to join the conversation.
- bkemler
-
Topic Author
- Offline
- Premium Member
- Posts: 87
Make sure you use Jimmy P's edit since I forgot to close a tag.
Please Log in or Create an account to join the conversation.
- Shreyas Khatri
-
- Offline
- New Member
- Posts: 2
Please Log in or Create an account to join the conversation.