සැකිල්ල:IP-user other
none
This is the {{IP-user other}} meta-template.
This template helps other templates detect if they are on an IP-user page or some "other" type of page. It detects both the subject page and talk page of an IP-user as "IP-user". It also detects the subpages and subsubpages of an IP-user, for instance it considers "User:12.34.56.78/subpage" as "IP-user".
Usage
[සංස්කරණය]This template usually takes two parameters, like this:
{{IP-user other | IP-user text | Other pages text }}
If this template is on an IP-user page, it will return this:
- IP-user text
If this template is on any other page, it will return this:
- none
The "page" parameter
[සංස්කරණය]This template can take a parameter named page. Like this:
{{IP-user other | IP-user text | Other pages text | page = User:12.34.56.78 }}
No matter on what kind of page the code above is used it will return this:
- IP-user text
The page parameter makes this template behave exactly as if on that page. The pagename doesn't have to be an existing page.
If the parameter is empty or undefined, the name of the current page determines the result.
You can make it so your template also understands the page parameter. That means you can demonstrate the different appearances of your template in the documentation for your template. Then do like this:
{{IP-user other | IP-user text | Other pages text | page = {{{page|}}} }}
Technical details
[සංස්කරණය]Templates have a problem to handle parameter data that contains equal signs "=
". But that is easily solved by using numbered parameters. Like this:
{{IP-user other | 1 = IP-user text | 2 = Other pages text | page = {{{page|}}} }}
If your template is using tables, then you need to know this:
Templates have a problem to handle parameter data that contains pipes "|
", unless the pipe is inside another template {{name|param1}}
or inside a piped link [[Help:Template|help]]
. Thus templates can not handle wikitables as input unless you escape them by using the {{!}} template. This makes it hard to use wikitables as parameters to templates. Instead the usual solution is to use "HTML wikimarkup" for the table code, which is more robust.
For more technical details, see the talk page.
See also
[සංස්කරණය]Pagename-handling and detection templates:
- {{pgn}} – Can take apart and put together pagenames in several ways.
- {{basepage subpage}} – For detecting if on a basepage, subpage or subsubpage.
- {{if pagename}} – For pattern matching on the pagename.
- {{if pagename multi}} – For pattern matching on the pagename, has input reuse.
- {{IP-user other}} – For detecting IP-user pages.
Easy to use namespace-detection templates:
- {{main other}} – For article templates.
- {{talk other}} – For talk page templates.
- {{user other}} – For user page templates.
- {{wikipedia other}} – For detecting "Wikipedia:" pages.
- {{file other}} – For file (image) templates.
- {{template other}} – For detecting template pages.
- {{help other}} – For help page templates.
- {{category other}} – For category templates.
- {{portal other}} – For portal templates.
- {{book other}} – For detecting book pages.
More complex namespace-detection templates:
- {{namespace detect}} – The very versatile one.
- {{namespace detect showall}} – The extremely versatile one, has input reuse.
- {{talkspace detect}} - For detecting talk pages on various namespaces.
Technical stuff:
- mw:Help:Magic words – About
{{NAMESPACE}}
etc. - mw:Help:Extension:ParserFunctions – About
{{#ifeq:|||}}
etc.