Mailing List Archive

Facebook grabs the Mediawiki logo instead of the site logo
Here Facebook grabs the Mediawiki logo instead of the site logo.

http://www.facebook.com/groups/tg.taiwan/permalink/374509135949001/?comment_id=374537129279535&offset=0&total_comments=1

Doing the same experiment with e.g.,
http://en.wikipedia.org/wiki/1st_clan_chief ,
a page also without any user embedded images,
oddly does not cause the mediawiki logo to be chosen.

Though it does not choose the site logo, at least it doesn't choose the
mediawiki logo.

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: Facebook grabs the Mediawiki logo instead of the site logo [ In reply to ]
On Mon, Jun 4, 2012 at 7:35 PM, <jidanni@jidanni.org> wrote:
> Here Facebook grabs the Mediawiki logo instead of the site logo.
>
> http://www.facebook.com/groups/tg.taiwan/permalink/374509135949001/?comment_id=374537129279535&offset=0&total_comments=1
>
> Doing the same experiment with e.g.,
> http://en.wikipedia.org/wiki/1st_clan_chief ,
> a page also without any user embedded images,
> oddly does not cause the mediawiki logo to be chosen.
>
> Though it does not choose the site logo, at least it doesn't choose the
> mediawiki logo.
>

Didn't we discuss this almost a year ago?

Indeed, we did:
http://lists.wikimedia.org/pipermail/mediawiki-l/2011-July/037710.html

-Chad

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: Facebook grabs the Mediawiki logo instead of the site logo [ In reply to ]
Yeah I remember that.
On Jun 4, 2012 7:45 PM, "Chad" <innocentkiller@gmail.com> wrote:

> On Mon, Jun 4, 2012 at 7:35 PM, <jidanni@jidanni.org> wrote:
> > Here Facebook grabs the Mediawiki logo instead of the site logo.
> >
> >
> http://www.facebook.com/groups/tg.taiwan/permalink/374509135949001/?comment_id=374537129279535&offset=0&total_comments=1
> >
> > Doing the same experiment with e.g.,
> > http://en.wikipedia.org/wiki/1st_clan_chief ,
> > a page also without any user embedded images,
> > oddly does not cause the mediawiki logo to be chosen.
> >
> > Though it does not choose the site logo, at least it doesn't choose the
> > mediawiki logo.
> >
>
> Didn't we discuss this almost a year ago?
>
> Indeed, we did:
> http://lists.wikimedia.org/pipermail/mediawiki-l/2011-July/037710.html
>
> -Chad
>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>
_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: Facebook grabs the Mediawiki logo instead of the site logo [ In reply to ]
It's because the site logo is added via a background image and the
only image it finds in that image next to the text "page is the
powered by MediaWiki". It would show the site logi if the logo was
changed to an image tag instead. Alternatively a meta tag such as
<meta property="og:image" content="..path/sitelogo.png" /> could be
added to the head of the document (possibly via some kind of hook) to
get the desired effect.

On Tue, Jun 5, 2012 at 12:47 AM, John Du Hart <compwhizii@gmail.com> wrote:
> Yeah I remember that.
> On Jun 4, 2012 7:45 PM, "Chad" <innocentkiller@gmail.com> wrote:
>
>> On Mon, Jun 4, 2012 at 7:35 PM,  <jidanni@jidanni.org> wrote:
>> > Here Facebook grabs the Mediawiki logo instead of the site logo.
>> >
>> >
>> http://www.facebook.com/groups/tg.taiwan/permalink/374509135949001/?comment_id=374537129279535&offset=0&total_comments=1
>> >
>> > Doing the same experiment with e.g.,
>> > http://en.wikipedia.org/wiki/1st_clan_chief ,
>> > a page also without any user embedded images,
>> > oddly does not cause the mediawiki logo to be chosen.
>> >
>> > Though it does not choose the site logo, at least it doesn't choose the
>> > mediawiki logo.
>> >
>>
>> Didn't we discuss this almost a year ago?
>>
>> Indeed, we did:
>> http://lists.wikimedia.org/pipermail/mediawiki-l/2011-July/037710.html
>>
>> -Chad
>>
>> _______________________________________________
>> Wikitech-l mailing list
>> Wikitech-l@lists.wikimedia.org
>> https://lists.wikimedia.org/mailman/listinfo/wikitech-l
>>
> _______________________________________________
> Wikitech-l mailing list
> Wikitech-l@lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/wikitech-l



--
Jon Robson
http://jonrobson.me.uk
@rakugojon

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: Facebook grabs the Mediawiki logo instead of the site logo [ In reply to ]
But both my page and the Wikipedia page both have only the site logo, and 'powered by' footer icons.
How does Facebook know not to mistakenly show a 'powered by' icon for Wikipedia but not my site?
Unfair!

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: Facebook grabs the Mediawiki logo instead of the site logo [ In reply to ]
OK, <meta property="og:image" content="$wgLogo" />
is what I need to add to the header of each page, as my site has no
images at all except for the logo. I use the latest git version of MediaWiki.

In OutputPage.php we see
function addMeta( $name, $val ) {
array_push( $this->mMetatags, array( $name, $val ) );
But then http://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay leads to
http://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_for_extension_developers
which makes one utterly totally lost. OK, then I found
http://www.mediawiki.org/wiki/Extension:OpenGraphMeta
which of course does exactly what I want... and much more.
But I don't to install any extensions. All I want is to add
that one little line
<meta property="og:image" content="$wgLogo" />
with the $ variable (expanded
like $meta["og:image"] = wfExpandUrl($wgLogo); )
or something. So how do I write the one line hook please?!

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: Facebook grabs the Mediawiki logo instead of the site logo [ In reply to ]
I believe this should help you:
http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/OpenGraphMeta/OpenGraphMeta.php?view=markup#l61

Personally I'd just install the extension though.. you may find you
want the other things too :)

Jon

On Tue, Jun 19, 2012 at 1:40 PM, <jidanni@jidanni.org> wrote:
> OK, <meta property="og:image" content="$wgLogo" />
> is what I need to add to the header of each page, as my site has no
> images at all except for the logo. I use the latest git version of MediaWiki.
>
> In OutputPage.php we see
>        function addMeta( $name, $val ) {
>                array_push( $this->mMetatags, array( $name, $val ) );
> But then http://www.mediawiki.org/wiki/Manual:Hooks/BeforePageDisplay leads to
> http://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_for_extension_developers
> which makes one utterly totally lost. OK, then I found
> http://www.mediawiki.org/wiki/Extension:OpenGraphMeta
> which of course does exactly what I want... and much more.
> But I don't to install any extensions. All I want is to add
> that one little line
> <meta property="og:image" content="$wgLogo" />
> with the $ variable (expanded
> like $meta["og:image"] = wfExpandUrl($wgLogo); )
> or something. So how do I write the one line hook please?!



--
Jon Robson
http://jonrobson.me.uk
@rakugojon

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: Facebook grabs the Mediawiki logo instead of the site logo [ In reply to ]
OK, this extract works for 1.20
function JidanniOpenGraphMetaPageHook(&$out,&$sk){global $wgLogo;
$out->addHeadItem("meta:property:og:image",
Html::element('meta',array('property'=>'og:image','content'=>wfExpandUrl($wgLogo)))."\n");return true;}
$wgHooks['BeforePageDisplay'][] = 'JidanniOpenGraphMetaPageHook';

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l