Topic-icon og:image does not use Joomla article image(s)

Active Subscriptions:

None
Hi,

For some reason JFBConnect does not use the actual article image for og:image, why? Looking at the code you search the article text for <img> tags and use that, never adding the article image, why? The article image should always be used if it exists.

quickfix:
    protected function getFirstImage($article)
    {
        if (isset($article->text))
            $articleText = $article->text;
        else
            $articleText = $article->introtext . $article->fulltext;

        $fullImagePath = $this->getFirstImageFromText($articleText);
        $json = json_decode($article->images, true);
        if ( !empty($json['image_fulltext']) ) {
            $fullImagePath = $json['image_fulltext'];
        }
        
        return $fullImagePath;
    }
The topic has been locked.
Support Specialist
3 years 7 months ago #66679 by mel
JFBConnect provides an option to select which image to use when you set up an Object in the Social Meta area, whether it be the first image in an article, the article image, the category image, a custom image, etc. You can see in the Open Graph plugin for Joomla (plugins/opengraph/content.php) in the setOpenGraphTags method. We don't automatically set tags on pages unless the user has configured an object, used an Easy Tag or set up a default value, as there are many other extensions that we have to play nicely with.

-Melissa
The topic has been locked.
Active Subscriptions:

None
3 years 7 months ago #66680 by nettstudio
Thanks for your fast reply/solution :)
The topic has been locked.
Support Specialist
3 years 7 months ago #66681 by mel
No problem! If you need details on how to set up Objects / Tags, check out our documentation here .

-Melissa
The topic has been locked.