Extension:TagContent

TagContent is an extension to define tags that wrap some content in a predefined template, usually for higher readabillity or to ease processing.

Installation

 * 1) Download TagContent.php and TagContent.i18n.php, and save them in extensions/TagContent directory on your wiki.
 * 2) Insert this line in the LocalSettings.php file:
 * 3) Adapt   and

Usage
Several new tags can be defined and each one of them maps to a predefined page acting like an ordinary template with the tag content as the first anonymous parameter and the attributes as named parameters. All ordinary wikisyntax are valid for the messages.

The extension use one page for definition of the tag functions, if a tag isn't defined it will act as an usual tag and will be stripped in the cleanup phase. A tag can't override an already defined tag function or a blacklisted tag. IAn allowed namespace must be part of the tag.

The definition for a mapping can also include defaults for the named parameters. These will override the defaults given in the template as those will newer be used.

* mediawiki:test|foo=bar
 * Example for "Mediawiki:Tags-definition"

The tag "test" will be checked against previous definitions and the blacklist before it is accepted. The remaining string is assumed to be regular wikisyntax and appended to the call. The following wikicode will then be rewritten from lorem ipsum dolor sit amet, &lt;test&gt;consectetur adipisicing elit&lt;/test&gt;, sed do eiusmod tempor... into the following form lorem ipsum dolor sit amet,, sed do eiusmod tempor...

The tag form can be more readable than the parser function form, and it is a lot easier to parse with a quick and dirty regexp expression.

Alternatives

 * Not known

Feedback
Use the discussion page for feedback, questions, feature requests and bug reports.