Page MenuHomePhabricator

Special template prefix extensions
Closed, ResolvedPublic

Description

Author: Astronouth7303

Description:
(Think of GRAMMER, SUBST, or PLURAL, but with <your text here> instead.)

This is an RFE for {{foo:...}}-type hooks, with arguments. I think examples will
clear it up.

(This also applies to 1.6, but I always implement RFEs for now.)


Version: 1.6.x
Severity: enhancement

Details

Reference
bz4294

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:59 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz4294.
bzimport added a subscriber: Unknown Object (MLST).

Astronouth7303 wrote:

Patch to implement (for 1.5)

This does basic implementation for 1.5. Would require almost no change for 1.6
(just move down to 2413-ish). Doesn't handle SpecialVersion.php

attachment SpecialTemplatePrefix.patch ignored as obsolete

Astronouth7303 wrote:

A demo of a hook using this.

This is a demo using this hook. Basically outputs what was put in, in another
form.

Attached:

Astronouth7303 wrote:

Patch to implement (for 1.5), including Special:Version

This is identical to the previous patch, except for the addition of
SpecialVersion.php, and the changes needed in that.

attachment SpecialTemplatePrefix.patch ignored as obsolete

Astronouth7303 wrote:

Patch to implement (for 1.6)

This is the same as attachment #1253, but for CVS HEAD.

Attached:

Astronouth7303 wrote:

Are there any registered ways to reduce any performance hits of this hook?
Because ''every'' hook is called on ''every'' inclusion, several hooks could
hurt performance.

Don't use the filter chains in $wgHooks for something like this; use a by-keyword callback
registration like we have for parser tag hooks.

robchur wrote:

You can now write parser functions extensions implementing these sorts of things.

Astronouth7303 wrote:

Since there is no patch or reference as to how to do this, I'll mention that you
need to call Parser::setFunctionHook() to add a "parser function" it.