-
AuthorPosts
-
January 21, 2013 at 8:34 pm #184237
Hi
I published a (french) website made with Ja Lens but a problem is remaining with Facebook : the meta description of the items contains Html characters and it looks awful when I share an item on Facebook
What the Meta looks like in source code of item page :
<meta name=”og:description” content=”<p>Traitement HDR sur Photomatix pour Minnie.</p>” />
<meta name=”description” content=”<p>Traitement HDR sur Photomatix pour Minnie.</p>” />
Inside the componentcom_k2viewsitemview.html.php :
$document->setMetaData(‘og:description’, htmlspecialchars(strip_tags($document->getDescription()), ENT_QUOTES, ‘UTF-8’));Example page : http://www.ctaninfographie.fr/index.php/fr/traitements-photos/item/51-minnie
Can you help me to solve this problem ?
Thank you in advance
Thb60
Stork11 FriendStork11
- Join date:
- March 2011
- Posts:
- 2273
- Downloads:
- 0
- Uploads:
- 142
- Thanks:
- 55
- Thanked:
- 431 times in 393 posts
January 22, 2013 at 11:02 am #480766Hello thb60,
Because $document->getDescription() used htmlspecialchars before getting site description. So strip_tags in this case is useless. I used htmlspecialchars_decode to decode description before using strip_tags.
Code should be edited:
[PHP]$document->setMetaData(‘og:description’, htmlspecialchars(strip_tags(htmlspecialchars_decode($document->getDescription())), ENT_QUOTES, ‘UTF-8’));[/PHP]Regards.
1 user says Thank You to Stork11 for this useful post
January 22, 2013 at 4:14 pm #480789Thank you very much Stork, you made my day ! 🙂
thb60AuthorPostsViewing 3 posts - 1 through 3 (of 3 total)This topic contains 3 replies, has 2 voices, and was last updated by thb60 11 years, 11 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
HTML Chars in K2 item’s Meta Description
Viewing 3 posts - 1 through 3 (of 3 total)