https://www.infra-repository.org/oiar/index.php?title=Template:Template_other/doc&feed=atom&action=historyTemplate:Template other/doc - Revision history2024-03-28T11:41:22ZRevision history for this page on the wikiMediaWiki 1.40.0https://www.infra-repository.org/oiar/index.php?title=Template:Template_other/doc&diff=173&oldid=prevJan Schoonderbeek: linkfixes for tlx2013-03-24T19:51:24Z<p>linkfixes for tlx</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 20:51, 24 March 2013</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l2">Line 2:</td>
<td colspan="2" class="diff-lineno">Line 2:</td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --></div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div><!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --></div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>This is the {{<del style="font-weight: bold; text-decoration: none;">tl</del>|template other}} meta-template.</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>This is the {{<ins style="font-weight: bold; text-decoration: none;">tlx</ins>|template other}} meta-template.</div></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr>
<tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It helps other templates detect if they are on a "Template:" page or some "other" type of page.</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>It helps other templates detect if they are on a "Template:" page or some "other" type of page.</div></td></tr>
</table>Jan Schoonderbeekhttps://www.infra-repository.org/oiar/index.php?title=Template:Template_other/doc&diff=172&oldid=prevJan Schoonderbeek: doc copied2013-03-24T19:51:06Z<p>doc copied</p>
<p><b>New page</b></p><div>{{documentation subpage}}<br />
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --><br />
<br />
This is the {{tl|template other}} meta-template.<br />
<br />
It helps other templates detect if they are on a "Template:" page or some "other" type of page.<br />
<br />
=== Usage ===<br />
<br />
This template usually takes two parameters, like this:<br />
<br />
<pre><br />
{{template other | Template page text | Other pages text }}<br />
</pre><br />
<br />
If the template is on a "Template:" page, it will return this:<br />
<br />
:{{template other | Template page text | Other pages text }}<br />
<br />
If the template is on any other page, it will return this:<br />
<br />
:{{template other | demospace=other | Template page text | Other pages text }}<br />
<br />
A typical usage case could be to make it so that a template only adds a category when not on a template page. Thus not adding the template itself and other templates that are built with it to the category. Like this:<br />
<br />
<pre><br />
{{template other | | [[Category:Some maintenance category]] }}<br />
</pre><br />
<br />
Note that in the example above the "template" parameter was left empty.<br />
<br />
=== Demospace ===<br />
<br />
For testing and demonstration purposes this template can take a parameter named '''demospace'''. <br />
<br />
* If it has the value '''template''' it returns the template page text.<br />
* It if has the value '''other''' or any other value such as the name of some other namespace it returns the other pages text.<br />
* If the parameter is empty or undefined, the actual page type determines the result.<br />
<br />
Like this:<br />
<br />
<pre><br />
{{template other <br />
| Template page text <br />
| Other pages text <br />
| demospace = template<br />
}}<br />
</pre><br />
<br />
No matter on what kind of page the code above is used it will return this:<br />
<br />
:{{template other <br />
| Template page text <br />
| Other pages text <br />
| demospace = template<br />
}}<br />
<br />
You can make it so your template also understands the '''demospace''' parameter. That means you can demonstrate the different appearances of your template in the documentation for your template. Then do like this:<br />
<br />
<pre><br />
{{template other <br />
| Template page text <br />
| Other pages text <br />
| demospace = {{{demospace|}}}<br />
}}<br />
</pre><br />
<br />
=== Technical details ===<br />
<br />
This template detects "Template talk:" pages as type '''other'''.<br />
<br />
<includeonly><br />
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS --><br />
[[Category:Utility templates]]<br />
<br />
</includeonly></div>Jan Schoonderbeek