Topic on Extension talk:NumberedHeadings

__NUMBEREDHEADINGS__ in a template

4
Summary by Kghbln
Garonenur (talkcontribs)

I would like to add the magic word with a template, to shield my users from to much technicalities, any idea why this seems not to work? while e.g. __TOC__ works?

Пика Пика (talkcontribs)

I guess this may happen because the parsing of the magical word __NUMBEREDHEADINGS__ happens when parsing the template, not the article that uses the template. Could you try to add some headings inside the template and see if they come out autonumbered?

If this is the case, it is probably because the parsing is tied to a parser hook onParserBeforeInternalParse() (see the source code of the extension at https://github.com/staspika/mediawiki-numberedheadings/blob/master/NumberedHeadings.class.php). Would you like to try to find and suggest a better suited hook? :)

Lsilverman (talkcontribs)

I have the same issue with this plugin. There is an older extension I had been using that suffers from the same problem: Extension:MagicNumberedHeadings

In the Discussion on that plugin, the author recommends hooking <code>InternalParseBeforeLinks</code>.

I tried this in the other extension, and it worked.

Пика Пика (talkcontribs)