No bug No Twitter cards and OG tags on Featured and Category Blog pages?

More
1 year 4 months ago #2306 by Robert Fairhead
Hi, 

I bought ochOpenGraph today, having investigated other options and read your documentation. (I currently use sh404SEF on a Joomla 3 website which I'm testing as a Joomla 4 upgrade.)

I hadn't realised that the plug-in only creates Twitter cards and OG tags for Articles, not Featured or Category Blog pages. (I use a Featured layout for my home page.)

I saw in your support forum someone had a similar problem. Is there a simple workaround, or do I have to create Custom Fields for the Featured/home page and all the Category Blog/submenu pages?

Regards, Robert
The topic has been locked.
More
1 year 4 months ago #2307 by Ruud van Lent
Hi Robert,
thanks for reaching out. And thanks for your subscription!

Correct. ochOpenGraph automatically adds the metatags to views (like an article) that trigger a so called onContentPrepare event. When calling this it will pass the content (the article). ochOpenGraph will then get triggered on the event. parses the content it receives and adds the tags.

So this is 'basically' how it works.

On a featured / category view however there are multiple articles. So if you have 10 articles on a featured view, onContentPrepare is triggered for each article: 10 times. So what should be added in this case? That is why it doesn't work on these pages (it works, but it is disabled / not implemented in the code).

Now the trick / workaround here is that on these pages you can add a custom module (which only shows on this / these pages) with in the content { ochopengraph}
You then set this module to prepare content (setting in the module) and disable cache on the module.

Now when you visit the featured / categories page, the module is 'displayed' and the tag is replaced and turned into metatags for this page.

This gives you full control even on these pages!

you can read more on how to do that in the documentation ( onlinecommunityhub.nl/documentation/ochopengraph-content-plugin) > tab Documentation > tab Manual Settings

I hope this helps!
if not feel free to follow up :)

regards,
Ruud.
The topic has been locked.
More
1 year 4 months ago #2313 by Robert Fairhead
Thanks for your prompt response, Ruud. I will try the workaround tomorrow. By coincidence, I attended a Virtual Joomla User Group meeting for Australian Joomla people tonight, and one of our topics was OG tags and Twitter cards (and other metadata). I mentioned your plugin, and one of the Joomla website developers, Nathan Morrow, said he used it, too. So we're planning to exchange notes on it.

Regards, Robert
The topic has been locked.
More
1 year 4 months ago #2315 by Ruud van Lent
Cool!
Small world :)
let me know if you succeed or not.
regards,
Ruud
The following user(s) said Thank You: Robert Fairhead
The topic has been locked.
More
1 year 4 months ago #2320 by Robert Fairhead
Hi Ruud,

Your {ochopengraph} in a Custom module workaround works perfectly, thanks!

I now have OG tags and Twitter Cards in my Articles and Featured and Category Blog menu items.

Regards, Robert
The topic has been locked.
More
1 year 4 months ago #2321 by Ruud van Lent
Thanks for reporting back Robert!
Good to hear it works (although I must say that I already suspected that :))

Will close this topic. If you have any new / follow up questions feel free to open a new topic.

Regards,
Ruud.
The topic has been locked.