Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • thb60 Friend
    #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


    1. CTan-Facebook
    Stork11 Friend
    #480766

    Hello 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.

    thb60 Friend
    #480789

    Thank you very much Stork, you made my day ! 🙂
    thb60

Viewing 3 posts - 1 through 3 (of 3 total)

This topic contains 3 replies, has 2 voices, and was last updated by  thb60 11 years, 10 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum