Topic on Extension talk:PageImages

Geraki (talkcontribs)

So, is there any chance for including Open Graph in the page itself?

<meta property="og:image" content="http://example.com/w/images/thumb/7/70/Example.png/48px-Example.png" />

I hope so.

MaxSem (talkcontribs)

Frankly, I'm a bit wary of adding more cruft to page HTML. Is there a demand for this?

Nemo bis (talkcontribs)

If that's really used by Facebook I must say that I hate it, but from a MediaWiki/Wikimedia perspective making pages look better when linked on it seems enough of a good reason.

Geraki (talkcontribs)

It seems essential if we prefer that links to Wiki[pm]edia pages are presented with an appropriate thumbnail instead of the mediawiki logo or 'featured article' sign.

In fact it will be helpful not only to wikipedia but to every wiki, so at least there should be an option to enable/disable it.

Florianschmidtwelzow (talkcontribs)

The Open Graph Extension adds an image for og:image, using the MainImage of $out (mMainImage). Maybe the developer can use the Image of pageImages, that is much better as the first main Image on page :)

Nemo bis (talkcontribs)

Yes, we've seen quite a demand for this lately and it would be nice.

Hollosch (talkcontribs)

Hi, have you found a solution to including the og:image property?

Stefahn (talkcontribs)

Just came across this. You can add an og:image to your site by the following code in your LocalSettings.php:

$wgHooks['BeforePageDisplay'][] ='MyFunction';
function MyFunction(&$out, &$skin) {
    $script = "<meta property='og:image' content='/pics/YourPic.png'>";
    $out->addHeadItem("My script", $script);
    return true;

};

Be aware that this will set YourPic.png as og:image in all of your pages.

If you want to set og:image only on your Main page see User:Stefahn/Docu#Get_the_title_of_a_page.

Chuck.Kahn (talkcontribs)
Reply to "Open Graph image?"