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

From Zoophilia Wiki
Jump to navigationJump to search
meta>Funandtrvl
(organize)
m (41 revisions imported)
 
(32 intermediate revisions by 11 users not shown)
Line 1: Line 1:
Pagename-handling and detection templates:
{{Navbox
| name = Namespace and pagename-detecting templates
| state = {{{state|{{{1|<noinclude>expanded</noinclude>}}}}}}
| bodyclass=hlist
| 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
* {{tl|if pagename multi}} – For pattern matching on the pagename, has input reuse.
  |groupstyle=font-weight:normal;
* {{tl|IP-talk}} – Return: 1) IP user talk page 2) registered user talk page 3) not user talk page.
* {{tl|IP-user other}} – For detecting IP-user pages.


Easy to use namespace-detection templates:
  | group1 = Particular
  | list1 =
* {{tlbare|Main other}}
* {{tlbare|Talk other}}
* {{tlbare|Book other}}
* {{tlbare|Category other}}
* {{tlbare|Draft other}}
* {{tlbare|File other}}
** {{tlbare|Is Commons}}
* {{tlbare|Help other}}
* {{tlbare|Module other}}
* {{tlbare|Portal other}}
* {{tlbare|Template other}}
* {{tlbare|User other}}
* {{tlbare|Wikipedia other}}
* {{tlbare|Single namespace}}
* {{tlbare|If talkspace of}}
* {{tlbare|If usertalk of}}
  | group2 = More generic
  | list2 =
* {{tlbare|Namespace detect}}
* {{tlbare|Namespace detect showall}}
* {{tlbare|Main talk other}}
** {{tlbare|Main talk other flex}}
* {{tlbare|Talkspace detect}}
}}


* {{tl|main other}} – For article templates.
| group2 = [[Wikipedia:Page name|Pagename]]
* {{tl|talk other}} – For talk page templates.
| list2 = {{navbox|subgroup
* {{tl|book other}} For detecting book pages.
  | groupstyle = line-height:1.2em; font-weight:normal; background:transparent;
* {{tl|category other}} – For category templates.
  | liststyle = line-height:1.2em
* {{tl|file other}} – For file (image) templates.
  | group1 = {{tlbare|When on basepage}}
* {{tl|help other}} For help page templates.
  | list1 = Detects and acts according to whether it is on a basepage ''or'' on any subpage (that is, a <code>../..</code> subpage).
* {{tl|portal other}} – For portal templates.
  | group2 = {{tlbare|When pagename is}}
* {{tl|template other}} – For detecting template pages.
  | list2  = For pattern matching on the pagename.
* {{tl|user other}} – For user page templates.
  | group3 = [[Module:Page]]
* {{tl|wikipedia other}} – For detecting "Wikipedia:" pages.
  | list3  = Can take apart and put together pagenames in several ways.
  | group4 = {{tlbare|IP-talk}}
  | list4  = Returns IP-user talkpage, registered-user talkpage or non-user talkpage.
  | group5 = {{tlbare|IP-user other}}
  | list5  = For detecting IP-user pages.
  | group6 = {{tlbare|Subpage other}}
  | list6  = Pagename has an after-slash part (not in mainspace)
  | group7 = {{tlbare|Sandbox other}}
  | list7  = Page is subpage /sandbox (template space)
  | group8 = {{tlbare|Testcases other}}
  | list8  = Page is subpage /testcases (template space)
}}


More complex namespace-detection templates:
| group3 = Others
| list3 = {{navbox|subgroup
  | groupstyle = line-height:1.2em; font-weight:normal; background:transparent;
  | liststyle = line-height:1.2em
  | group1 = {{tlbare|Stub other}}
  | list1 = Detects whether it is on a page with a stub template or not.
  | group2 = {{tlbare|Preview other}}
  | list2 = Detects whether page is viewed as a preview or not.
}}


* {{tl|namespace detect}} – The very versatile one.
| below =
* {{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]]


Technical stuff:
}}<noinclude>
 
{{documentation}}
* [[Wikipedia:Namespace]] – Lists all the namespaces.
* [[mw:Help:Magic words]] – About <code><nowiki>{{NAMESPACE}}</nowiki></code> etc.
* [[mw:Help:Extension:ParserFunctions]] – About <code><nowiki>{{#ifeq:|||}}</nowiki></code> etc.<noinclude>
{{Documentation}}
<!--Please add this template's categories to the /doc subpage, not here - thanks!-->
</noinclude>
</noinclude>

Latest revision as of 04:48, 3 September 2020