https://wiki.tiplanet.org/index.php?title=Mod%C3%A8le:Main_other/doc&feed=atom&action=history Modèle:Main other/doc - Historique des versions 2024-03-28T23:47:07Z Historique des versions pour cette page sur le wiki MediaWiki 1.40.0 https://wiki.tiplanet.org/index.php?title=Mod%C3%A8le:Main_other/doc&diff=577&oldid=prev Adriweb : 1 version 2012-09-03T14:13:31Z <p>1 version</p> <p><b>Nouvelle page</b></p><div>{{documentation subpage}}<br /> {{high-risk| 2,000,000+ }}<br /> {{template shortcut|ns0}}<br /> &lt;!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --&gt;<br /> <br /> This is the {{tl|main other}} meta-template.<br /> <br /> This template helps other templates detect if they are on a main space (article) page or some &quot;other&quot; type of page.<br /> <br /> === Basic usage ===<br /> <br /> This template usually takes two parameters, like this:<br /> <br /> &lt;pre&gt;<br /> {{main other | Article text | Other pages text }}<br /> &lt;/pre&gt;<br /> <br /> If the template is on a main space (article) page, it will return this:<br /> <br /> :{{main other | demospace=main | Article text | Other pages text }}<br /> <br /> If the template is on any other page, it will return this:<br /> <br /> :{{main other | Article text | Other pages text }}<br /> <br /> A typical usage case could be to make it so that a template only adds a category when on an article. Thus not adding other pages that just show the template. Like this:<br /> <br /> &lt;pre&gt;<br /> {{main other | [[Category:Some article maintenance category]] }}<br /> &lt;/pre&gt;<br /> <br /> Or to warn that a template should not be used on other pages:<br /> <br /> &lt;pre&gt;<br /> {{main other | | This template should only be used in articles. }}<br /> &lt;/pre&gt;<br /> <br /> Note that in the first case above the &quot;other&quot; parameter was not used, and in the second example the &quot;main&quot; 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 '''main''' it returns the article 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 /> &lt;pre&gt;<br /> {{main other <br /> | Article text <br /> | Other pages text <br /> | demospace = main<br /> }}<br /> &lt;/pre&gt;<br /> <br /> No matter on what kind of page the code above is used it will return this:<br /> <br /> :{{main other <br /> | Article text <br /> | Other pages text <br /> | demospace = main<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 /> &lt;pre&gt;<br /> {{main other <br /> | Article text <br /> | Other pages text <br /> | demospace = {{{demospace|}}}<br /> }}<br /> &lt;/pre&gt;<br /> <br /> === Technical details ===<br /> <br /> This template detects article &quot;Talk:&quot; pages as type '''other'''.<br /> <br /> This template works like {{tl|main talk other}}, for more examples and technical details see full documentation there.<br /> <br /> === See also ===<br /> <br /> {{namespace detect see also}}<br /> <br /> &lt;includeonly&gt;<br /> &lt;!-- CATEGORIES AND INTERWIKIS HERE, THANKS --&gt;<br /> [[Category:Namespace manipulation templates]]<br /> <br /> [[bn:টেমপ্লেট:Main other]] <br /> [[da:Skabelon:Artikel eller andet]]<br /> [[id:Templat:Main other]]<br /> [[mk:Шаблон:Main other]]<br /> [[mn:Загвар:Main other]]<br /> [[ja:Template:Main other]]<br /> [[ro:Format:Main other]]<br /> [[ru:Шаблон:Main other]]<br /> [[sl:Predloga:Main other]]<br /> [[uk:Шаблон:Main other]]<br /> [[ur:سانچہ:Main other]]<br /> [[zh:Template:Main other]]<br /> &lt;/includeonly&gt;</div> Adriweb