Adding html meta keywords to pages

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding html meta keywords to pages

tpamsler
Hello,

Is it possible to add html head meta keywords to wiki pages? Is there a
function or tag for doing this?

e.g.
[META name="keywords" content="foo,bar,something"]

Best,

--
Thomas Amsler



_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Adding html meta keywords to pages

Fernando Correia
Yes. Something like this:

global $wgOut;
$wgOut->addMeta($name, $value);

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Adding html meta keywords to pages

tpamsler
Fernando,

Thank you for the information.  Does this work per page? From the docs,
it says to add the "addMeta()" call to OutputPage.php. I would like to
create an extension where I can add this per wiki page.

e.g.

<htmlmeta>keyword1,keyword2,etc.</htmlmeta>

... and the extension would call addMeta(). Is that possible?

Best,/
/
Fernando Correia wrote:

> Yes. Something like this:
>
> global $wgOut;
> $wgOut->addMeta($name, $value);
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>  

--
Thomas Amsler
Programmer
IET Mediaworks, UC Davis
[hidden email]
W: (530) 754-5198
M: (916) 803-2226


_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Adding html meta keywords to pages

Rob Church
On 11/03/07, Thomas Amsler <[hidden email]> wrote:
> ... and the extension would call addMeta(). Is that possible?

The parser cache will neutralise that.


Rob Church

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Adding html meta keywords to pages

Fernando Correia
2007/3/12, Rob Church <[hidden email]>:
> The parser cache will neutralise that.

Correct. I forgot to mention that I run a crazy non-standard non-cached wiki.

All pages are dynamic, so I can add a meta tag using a parser hook.

I really can't tell how you could do it when cache is active.

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Adding html meta keywords to pages

Rob Church
On 12/03/07, Fernando Correia <[hidden email]> wrote:
> I really can't tell how you could do it when cache is active.

What we need (god, I hate that phrase) is:

1. An extension to the ParserOutput class which allows extensions to
add arbitrary items to the cache in a standard way, e.g.
$parser->getOutput()->addExtensionOutput( 'fooextension', new
MyCustomOutputThingy( blah blah ) );

2. Consistent hook calling on operations which "add" a ParserOutput
(which can be newly-generated or unserialised from the cache) to allow
the extension to access these "output extras" and utilise them.

We have an appropriate hook or two to allow extensions to alter cache
item tokens/hashes, to ensure caching is consistent, so that should be
usable. I *almost* added #1 a while ago (back when I added
__NEWSECTIONLINK__), but for some stupid reason, I decided not to;
more fool I.


Rob Church

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Adding html meta keywords to pages

Brion Vibber
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rob Church wrote:

> What we need (god, I hate that phrase) is:
>
> 1. An extension to the ParserOutput class which allows extensions to
> add arbitrary items to the cache in a standard way, e.g.
> $parser->getOutput()->addExtensionOutput( 'fooextension', new
> MyCustomOutputThingy( blah blah ) );
>
> 2. Consistent hook calling on operations which "add" a ParserOutput
> (which can be newly-generated or unserialised from the cache) to allow
> the extension to access these "output extras" and utilise them.

There's a half-done patch for that sitting in extensions/Aggregator. If
someone wants to pick it up and finish it, that'd be great.

- -- brion vibber (brion @ pobox.com / brion @ wikimedia.org)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9qriwRnhpk1wk44RAtwkAKDL6fJLFJZe8ULSAwDcN/VF0Lk3+gCfSiV8
iXOIuzIjYdO9QnknhtB20O8=
=It2G
-----END PGP SIGNATURE-----

_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: Adding html meta keywords to pages

Jim R. Wilson
On 3/11/07, Thomas Amsler wrote:
> Is it possible to add html head meta keywords to wiki pages? Is there a
> function or tag for doing this?

There wasn't when you asked the question, but there is now!

http://www.mediawiki.org/wiki/Extension:MetaKeywordsTag

Here's a thorough discussion of how it works:

http://jimbojw.com/wiki/index.php?title=Doing_more_with_MediaWiki_parser_extensions

I'll be happy to answer any questions.  Enjoy!

-- Jim R. Wilson (jimbojw)

On 3/13/07, Brion Vibber <[hidden email]> wrote:

>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Rob Church wrote:
> > What we need (god, I hate that phrase) is:
> >
> > 1. An extension to the ParserOutput class which allows extensions to
> > add arbitrary items to the cache in a standard way, e.g.
> > $parser->getOutput()->addExtensionOutput( 'fooextension', new
> > MyCustomOutputThingy( blah blah ) );
> >
> > 2. Consistent hook calling on operations which "add" a ParserOutput
> > (which can be newly-generated or unserialised from the cache) to allow
> > the extension to access these "output extras" and utilise them.
>
> There's a half-done patch for that sitting in extensions/Aggregator. If
> someone wants to pick it up and finish it, that'd be great.
>
> - -- brion vibber (brion @ pobox.com / brion @ wikimedia.org)
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFF9qriwRnhpk1wk44RAtwkAKDL6fJLFJZe8ULSAwDcN/VF0Lk3+gCfSiV8
> iXOIuzIjYdO9QnknhtB20O8=
> =It2G
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> MediaWiki-l mailing list
> [hidden email]
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
[hidden email]
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l