Keyword

[SOLVED] How to change og:image size for FaceBook?

  • Roman Lipatov
  • Roman  Lipatov's Avatar Topic Author
  • Offline
  • New Member
More
9 years 1 month ago #146422 by Roman Lipatov
How to change og:image size for FaceBook? was created by Roman Lipatov
Hi!

K2 generates very small images for FB.

How to change og:image size for FaceBook?
Is it possible to configure it with templates override?

Thanks.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #146427 by Joe Campbell
Replied by Joe Campbell on topic How to change og:image size for FaceBook?
Hi Roman,

Here's how to change the Facebook Open Graph image size (note: it requires hacking a K2 file):

1. Open File:
/components/com_k2/views/item/view.html.php

2. Find Code:
$facebookImage = 'image'.$params->get('facebookImage', 'Small');

3. Modify Code:
Change "Small" to desired image size.

I hope this helps,

Joe Campbell

Please Log in or Create an account to join the conversation.

  • Roman Lipatov
  • Roman  Lipatov's Avatar Topic Author
  • Offline
  • New Member
More
9 years 1 month ago - 9 years 1 month ago #146429 by Roman Lipatov
Replied by Roman Lipatov on topic How to change og:image size for FaceBook?
Thanks Joseph, but I tried this method before created this topic, and this didn't help me.

I use this code
facebookImage = 'image'.$params->get('facebookImage', 'Large');


When I open k2 article and check og:image parameter in html code still displays
<meta property="og:image" content="http://mysite.com/media/k2/items/cache/daf30d03da42a5291604b3fcca07f0d0_XS.jpg" />

_XS - smallest image
Last edit: 9 years 1 month ago by Roman Lipatov.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #146430 by Joe Campbell
Replied by Joe Campbell on topic How to change og:image size for FaceBook?
Here's a workaround...

User NoNumber ReReplacer ( www.nonumber.nl/extensions/rereplacer )
to change...

_XS.jpg" />
to
_L.jpg" />

Make sure to use the following "Search Areas" parameter:
Enable in area: Head (not in body)

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 1 month ago #146469 by Krikor Boghossian
Replied by Krikor Boghossian on topic How to change og:image size for FaceBook?
Actually the size is defined in K2's settings under the Social tab.
The setting is called "Image size to use when posting K2 items on Facebook"

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Roman Lipatov
  • Roman  Lipatov's Avatar Topic Author
  • Offline
  • New Member
More
9 years 1 month ago - 9 years 1 month ago #146506 by Roman Lipatov
Replied by Roman Lipatov on topic How to change og:image size for FaceBook?
Oh... Thanks!!!
Last edit: 9 years 1 month ago by Roman Lipatov.

Please Log in or Create an account to join the conversation.

More
9 years 1 month ago #146515 by Joe Campbell
Replied by Joe Campbell on topic How to change og:image size for FaceBook?
My apologies Roman for not knowing the direct solution - I use Extra Fields for all images (category, item, Facebook, Twitter Cards, etc.)
www.joomlaworks.net/forum/k2-en/40376-solved-keeping-orginal-names-in-my-images#141480

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum