No image when sharing blog entry on Facebook

Permalink
When I share a blog entry link on Facebook, there is no image pulled to fill the white space in the Facebook post, and so it looks blank/white, or if you look closely you see the reverse (white) version of our main logo which is illegible against the white box.

Is there an attribute field on the blog pages I can update/upload an image to so it will be shown when the content is shared?

Thank you

 
mnakalay replied on at Permalink Reply
mnakalay
for Facebook to pull an image from your page you need to use their open graph tags protocol. It's tags added to your page that allow Facebook to grab information such as title, description, image...

If you're using a newer version of C5 (5.7 and above or v8) you can use this free plugin:http://www.concrete5.org/marketplace/addons/open-graph-tags-lite1...

If you're using a legacy version of C5 you can use this one:http://www.concrete5.org/marketplace/addons/open-graph-tags-lite/...
ConcreteOwl replied on at Permalink Best Answer Reply
ConcreteOwl
Facebook have a developer debug tool to test for the correct OG Meta Tags
https://developers.facebook.com/tools/debug/...
Just enter the web address of your page and click 'Debug'.
Note, on first submission it may be necessary to run the debug tool twice to get the proper results.
Elstud replied on at Permalink Reply
Elstud
I found something interesting here but it was developed for Concrete5 v5.6, it may need some tweaks for 5.7/8:
Someone can help to adapt this for the last concrete 5 ?
because we should have in facebook the special picture from a news and the default picture in other case.

https://www.madesimplemedia.co.uk/blog/add-opengraph-tags-to-your-co...

<?php
        // Open Graph for articles
        $pageType = $c->getCollectionTypeHandle();
        if($pageType === "article") {
            $url = 'https://' . $_SERVER['HTTP_HOST'] . $c->getCollectionPath();
            $title = $c->getCollectionName();
            $desc = $c->getCollectionDescription();
            $ih = Loader::helper('image');
            $thumbnail = $c->getAttribute('featured');
            if($thumbnail) {
                $imageUrl = 'https://' . $_SERVER['HTTP_HOST'] . $ih->getThumbnail($c->getAttribute('featured'), 1200, 600)->src;
            }
            else {
                $imageUrl = "";
            }
ConcreteOwl replied on at Permalink Reply
ConcreteOwl
mnakalay has already posted the link on this thread...
Here it is again.
https://www.concrete5.org/marketplace/addons/open-graph-tags-lite1...