I wanted to use template overrides to change the correct file and in the correct LOGICAL place. Placing this code into a random place in a file that doesn't deal with the generation of the og meta tags, IS a hacky way of doing it. It...
OK. I could have just done that anyway. I wanted to to keep my code clean by just editing it where K2 sets the meta tag but it seems we don't know where that is. I have done it the way you suggested instead and although being quite a hacky way, it does work.
I can't find any reference to any of the Opengraph meta tags in item.php... can you be more specific?
Yes. I know about template overrides. But I do not know which file to override, hence my question.
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...
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?
Yes. Tried changing the size as well. No joy.
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
[corrected by moderator] Use template overrides... Copy the files: /components/com_k2/css/k2.css /components/com_k2/css/k2.print.css into: /templates/YOUR_TEMPLATE/css/ (create that folder if it doesn't exist) Then edit the 2 files there to override default...
More