Keyword

Opengraph Image tag not being rendered

  • Mark Fallon
  • Mark Fallon's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #132653 by Mark Fallon
Opengraph Image tag not being rendered was created by Mark Fallon
Hi,

I am using K2 Version 2.6.8.

The other Opengraph tags are rendered fine (url, title, description & type) but there is no og:image tag, even though the K2 item has an image set.

Any ideas?

Thanks

Mark

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #132654 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Opengraph Image tag not being rendered
Hello Mark,

Have you specified which image size you want to use?
This setting is located in K2's params.

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

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

  • Mark Fallon
  • Mark Fallon's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #132655 by Mark Fallon
Replied by Mark Fallon on topic Re: Opengraph Image tag not being rendered
Yes. Tried changing the size as well. No joy.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #132656 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Opengraph Image tag not being rendered
Is there a link I can see?

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

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

  • Mark Fallon
  • Mark Fallon's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #132657 by Mark Fallon
Replied by Mark Fallon on topic Re: Opengraph Image tag not being rendered
For some reason it only seems to affect the site on my localhost. The live site works OK... strange.

Another related question: If there is no image in the article, how can I set a default og:image src?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #132658 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Opengraph Image tag not being rendered
Facebook won't work on localhost.
Yes you can perform an if/else check in your template and if an image is not present you can use the setMetadata function docs.joomla.org/JDocument/setMetaData .

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

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

  • Mark Fallon
  • Mark Fallon's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #132659 by Mark Fallon
Replied by Mark Fallon on topic Re: Opengraph Image tag not being rendered
But what am I testing for? I can't run an if/else on the existence of an og:image tag, because wouldn't the template be loaded BEFORE K2? so there will never be an og:image tag at the time the if/else is executed.

I need to find the K2 file that sets the og:image tag so I can amend it. Have you any idea which file it is? I have searched through the file contents of the K2 folder to find "og:image" but no luck.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #132660 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Opengraph Image tag not being rendered
You do not need to hack K2 core files.
You will lose all your changes when you update.

This has to be done via template overrides.
You need to check if the image is both set and present.

This post will help you on template overrides.
getk2.org/documentation/tutorials/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.

  • Mark Fallon
  • Mark Fallon's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #132661 by Mark Fallon
Replied by Mark Fallon on topic Re: Opengraph Image tag not being rendered
Yes. I know about template overrides. But I do not know which file to override, hence my question.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 11 months ago #132662 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Opengraph Image tag not being rendered
It's the item.php file.

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

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


Powered by Kunena Forum