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.

Tags can be defined in LocalSettings.php or on a page in the message namespace if enabled. A tag on the tags definition page must not be predefined or be blacklisted. If a tag isn't predefined or defined on the tags definition page it will act as an usual tag and will possibly be stripped in the cleanup phase.

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 in this case. Multiple tags can map to the same template but with different parameters.


 * Example for LocalSettings.php

* mediawiki:test|foo=bar
 * Example for "Mediawiki&#58;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.