Hello
Is it somehow possible to use an extension or hook to generates content which spans several sections i.e. affects the table of contents?
My current results only render a "== title ==" like a normal title would be rendered but it still does not appear in the table of contents.
My favourite would be to have this included into a template, maybe sombody knows an existing extension which does something similar. I looked at the tinyMCE editor & co but they seem only to use the "save-after-editing" hook whereas I need something that makes a database query at every view.
bye,
-christian-
On Mon, 31 Mar 2008 17:03:48 +0100 "Thomas Dalton" thomas.dalton@gmail.com wrote:
My current results only render a "== title ==" like a normal title would be rendered but it still does not appear in the table of contents.
What method are you using at the moment?
Something like that:
$wgExtensionFunctions[] = "hwdb"; ... $wgParser->setHook( "hwdb:hardware", "renderHwdbHardware" ); ... function renderHwdbHardware($text, $args, &$parser) { $parser->disableCache(); ... $wiki_preformatted_output = getFromHwdb(...does SOAP call...)
// the variable now contains something like: // == Hardware == // * Manufactor: ... // * Model: ... // * Serial: ... // == Contact == // * Admin: ... // == Support Contracts == // ....
return $parser->recursiveTagParse($wiki_preformatted_output); }
In the Wiki Source I added hwdb:Hardwaremyhostname.netcologne.de</hwdb:Hardware>
The result properly renders the "==headings==" and the "* listitems" but the headings do not appear in the table of contents. Also the "edit section" links count from one, ignoring that there are sections before the hwdb:Hardware tag.
bye,
-christian-
AFAIK this is implemented by the extension Seealso you can find in SVN.
Cheers! Siebrand
-----Oorspronkelijk bericht----- Van: wikitech-l-bounces@lists.wikimedia.org [mailto:wikitech-l-bounces@lists.wikimedia.org] Namens Christian Hammers Verzonden: maandag 31 maart 2008 18:00 Aan: wikitech-l@lists.wikimedia.org Onderwerp: [Wikitech-l] Extension that adds "== heading =="?
Hello
Is it somehow possible to use an extension or hook to generates content which spans several sections i.e. affects the table of contents?
My current results only render a "== title ==" like a normal title would be rendered but it still does not appear in the table of contents.
My favourite would be to have this included into a template, maybe sombody knows an existing extension which does something similar. I looked at the tinyMCE editor & co but they seem only to use the "save-after-editing" hook whereas I need something that makes a database query at every view.
On 31/03/2008, Siebrand Mazeland s.mazeland@xs4all.nl wrote:
AFAIK this is implemented by the extension Seealso you can find in SVN.
I haven't tested it, but looking at the code it seems to just add an <h1> tag directly to the HTML at a fairly late stage. I can't see how it would add anything to the table of contents.
What's needed is a way for tag extensions to return wikitext rather than HTML - the problem is caused by parsing the wikitext for the tag as a separate call to the parser, rather than along with the rest of the page. Does such a method not exist? (I can't seem to find one.)
wikitech-l@lists.wikimedia.org