Template:Namespace and pagename-detecting templates: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Funandtrvl
add links
meta>Sardanaphalus
Derived from {{[Namespace/Pagename] detect see-also}}
Line 1: Line 1:
Pagename-handling and detection templates:
{{Navbox
| name = Namespace and pagename-detecting templates
| state = {{{state|{{{1|<noinclude>expanded</noinclude>}}}}}}
| title = Namespace and pagename-detecting templates


* {{tl|basepage subpage}} – For detecting if on a basepage, subpage or subsubpage.
| group1 = [[Wikipedia:Namespace|Namespace]]
* {{tl|pgn}} – Can take apart and put together pagenames in several ways.
| list1 =
* {{tl|if pagename}} – For pattern matching on the pagename.
{{Navbox |child |groupstyle=font-weight:normal;
* {{tl|if pagename multi}} – For pattern matching on the pagename, has input reuse.
  | group1 = "''X'' other"{{thinsp}}{{smallsup|1}}
* {{tl|IP-talk}} – Return: 1) IP user talk page 2) registered user talk page 3) not user talk page.
  | list1 = {{startflatlist}}
* {{tl|IP-user other}} – For detecting IP-user pages.
* {{tlbare|main other}}
* {{tlbare|talk other}}
* {{tlbare|book other}}
* {{tlbare|category other}}
* {{tlbare|draft other}}
* {{tlbare|file other}}
* {{tlbare|help other}}
* {{tlbare|module other}}
* {{tlbare|portal other}}
* {{tlbare|template other}}
* {{tlbare|user other}}
* {{tlbare|wikipedia other}}
{{endflatlist}}
  | group2 = More generic
  | list2 = {{startflatlist}}
* {{tlbare|namespace detect}}
* {{tlbare|namespace detect showall}}
* {{tlbare|main talk category other}}
* {{tlbare|main talk other}}
* {{tlbare|talkspace detect}}
}}


Easy to use namespace-detection templates:
<!---group2 omitted to maintain alternating list backgrounds--->


* {{tl|main other}} – For article templates.
| group3 = [[Wikipedia:Page name|Pagename]]
* {{tl|talk other}} – For talk page templates.
| list3 =
* {{tl|book other}} – For detecting book pages.
{{Aligned table
* {{tl|category other}} – For category templates.
  |style=text-align:left;line-height:1.3em;
* {{tl|draft other}} – For detecting draft pages.
  |col1style=padding-right:1.5em;
* {{tl|file other}} – For file (image) templates.
  | {{tlbare|when on basepage}} | Detects and acts according to whether it is on a basepage, subpage, subsubpage or beyond.
* {{tl|help other}} For help page templates.
  | {{tlbare|pgn}}               | Can take apart and put together pagenames in several ways.
* {{tl|module other}} For detecting module pages.
  | {{tlbare|if pagename}}       | For pattern matching on the pagename.
* {{tl|portal other}} – For portal templates.
  | {{tlbare|if pagename multi}} | For pattern matching on the pagename, has input reuse.
* {{tl|template other}} – For detecting template pages.
  | {{tlbare|IP-talk}}           | Returns IP-user talkpage, registered-user talkpage or non-user talkpage.
* {{tl|user other}} For user page templates.
  | {{tlbare|IP-user other}}     | For detecting IP-user pages.
* {{tl|wikipedia other}} – For detecting "Wikipedia:" pages.
}}


More complex namespace-detection templates:
| list5 = <div class="navbox-abovebelow" style="font-size:90%;">{{smallsup|1}} Detect and act according to whether they are on a page in the namespace ''X'' or elsewhere.</div>


* {{tl|namespace detect}} – The very versatile one.
| below = {{startflatlist}}
* {{tl|namespace detect showall}} – The extremely versatile one, has input reuse.
* [[Wikipedia:Namespace]]
* {{tl|main talk category other}} – Separates some namespaces.
* [[Wikipedia:Page name]]
* {{tl|main talk other}} – Separates some namespaces.
* [[mw:Help:Magic words|Magic words]]
* {{tl|talkspace detect}} – For detecting talk pages on various namespaces.
* [[mw:Help:Extension:ParserFunctions|ParserFunctions]]
{{endflatlist}}


Technical stuff:
}}<noinclude>
{{Documentation
| content =
{{Collapsible option |statename=optional}}


* [[Wikipedia:Namespace]] – Lists all the namespaces.
[[Category:Namespace manipulation templates| ]]
* [[mw:Help:Magic words]] – About <code><nowiki>{{NAMESPACE}}</nowiki></code> etc.
[[Category:Documentation see also templates]]
* [[mw:Help:Extension:ParserFunctions]] – About <code><nowiki>{{#ifeq:|||}}</nowiki></code> etc.<noinclude>
[[Category:Template namespace templates]]
{{Documentation}}
}}<!--(end Documentation)-->
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
</noinclude>

Revision as of 10:54, 30 September 2014