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,
Yes. Something like this:
global $wgOut; $wgOut->addMeta($name, $value);
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 MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On 11/03/07, Thomas Amsler tpamsler@ucdavis.edu wrote:
... and the extension would call addMeta(). Is that possible?
The parser cache will neutralise that.
Rob Church
2007/3/12, Rob Church robchur@gmail.com:
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.
On 12/03/07, Fernando Correia fernandoacorreia@gmail.com 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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Rob Church wrote:
What we need (god, I hate that phrase) is:
- 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 ) );
- 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)
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_ext...
I'll be happy to answer any questions. Enjoy!
-- Jim R. Wilson (jimbojw)
On 3/13/07, Brion Vibber brion@pobox.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Rob Church wrote:
What we need (god, I hate that phrase) is:
- 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 ) );
- 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 MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org