Implemented I can't get Twitter Cards to work with my Joomla site using K2

More
6 years 7 months ago #444 by Matthew Thompson
I get the following:

www.graphicdisplayworld.com

INFO: Page fetched successfully
INFO: 8 metatags were found
ERROR: No card found (Card error)

www.graphicdisplayworld.com/wideformat/i...h-efi-vutek-printers

INFO: Page fetched successfully
INFO: 21 metatags were found
INFO: twitter:card = summary_large_image tag found
ERROR: Possibly invalid value (if specified) (twitter:description)
ERROR: Possibly invalid value (if specified) (twitter:text:description)
ERROR: Possibly invalid value (if specified) (og:description)

I have no idea what I need to do to get this working.

Any help please?

Cheers

Mat Thompson
The topic has been locked.
More
6 years 7 months ago #445 by Ruud van Lent
Hi Mat,

Thanks for your report, sorry to hear you are having issues.
I will have a look in the morning and follow up.

Can you in the meantime enable debug (in ochOpenGraph plugin, tab advanced)?

Regards, Ruud
The topic has been locked.
More
6 years 7 months ago - 6 years 7 months ago #446 by Ruud van Lent
EDIT: just created a new version, will sent you this per email to test

Okay Mat, here we go :)

Question 1: your frontpage.
OpenGraph data is used to give you control over what is being shared on e.g. Facebook. The OpenGraph tags are filled with the information from an article / item (for K2).
Your frontpage is not an item / article, so the automatic process of filling the OpenGraph information will not work (Tat will only work on item pages / joomla articles).
But there is a manual solution where you tell the ochOpenGraph plugin what information to use for your frontpage (or other non item / article pages).

What you can do is:
1. upload a high resolution image that should be used when sharing your frontpage
2. create a Custom HTML module:
- In the [Options] tab set 'Prepare Content' to Yes
- insert the following code in the editor: {och_opengraph image=" onlinecommunityhub.nl/images/opengraph/support-og-fallback.jpg"}
- Set 'Show Title' to hide
- assign the module to a position on your frontpage

note: replace the image location in the example to your own uploaded (or existing) image

What will happen now is that when displaying your frontpage, the module is displayed en the contents of the module will be handles as a K2 item / Joomla article (prepare content). The OpenGraph (and Twitter card) tags will then be added.

Question 2: your K2 item page
Do not worry, all tags but the og:description tag are generated by the plugin correctly.
The og:description tag is generated by the information in the meta description field (from the K2 item or menu item).
What I think is that you have not filled in the meta information and rely on K2 to automatically fill that for you: K2 creates the <meta name="description" tag correctly.

When the og:description tag is missing Facebook (linkedin / google) will use the <meta name="description" tag > you can check this in the facebook share debug tool: developers.facebook.com/tools/debug/shar...h-efi-vutek-printers

Now I see that Twitter (via the Twitter card validator) will NOT use the <meta name="description" tag :(

They must have changed that recently.

I will come up with a solution for this: when the article / item metadesc field is empty I will generate text from the first x words in the article / item itself (same what K2 does when you leave that field empty).

As a work around you can fill the metadesc field in the item manually.

Can you tell me if the above (long) explanation is clear and if that 'fixes' your issues?
Last edit: 6 years 7 months ago by Ruud van Lent.
The topic has been locked.