• Home
  • Random
  • Nearby
  • Log in
  • Settings
Donate Now If Wikipedia is useful to you, please give today.
  • About Wikipedia
  • Disclaimers
Wikipedia

Template:IP-user other

  • Template
  • Talk
  • Language
  • Watch
  • View source


Template documentation[view] [edit] [history] [purge]
This template uses Lua:
  • Module:IPAddress (sandbox)

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 talk:12.34.56.78/subpage" as "IP-user".

It also detects IPv6 user pages, for instance it considers "User:2001:470:FD:3:0:0:0:80" as "IP-user".

It can also differentiate between IPv4 and IPv6 user pages if that is needed.

Contents

  • 1 Usage
    • 1.1 The "page" parameter
  • 2 Technical details
  • 3 See also

Usage

This template can be used in several different ways.

It can be used with unnamed 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:

Other pages text

It can also be used with named parameters, like this:

{{IP-user other 
| IP = IP-user text 
| other = 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:

Other pages text

If you need to differentiate between IPv4 and IPv6 user pages, then do like this:

{{IP-user other 
| IPv4 = IPv4 text
| IPv6 = IPv6 text
| other = Other pages text 
}}

If this template is on an IPv4 user page, for instance User talk:12.34.56.78/subpage, it will return this:

IPv4 text

If this template is on an IPv6 user page, for instance User:2001:470:FD:3:0:0:0:80, it will return this:

IPv6 text

If this template is on any other page, it will return this:

Other pages text

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
}}

Or perhaps clearer with the named parameters:

{{IP-user other
| IP = IP-user text 
| other = 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 = IP-user text 
| other = 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: "A = B"
| 2 = Other pages text: "C = D"
| page = {{{page|}}}
}}

Since this template also has named parameters, this is probably clearer:

{{IP-user other
| IP = IP-user text: "A = B"
| other = Other pages text: "C = D"
| 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.

This template calls Module:IPAddress which does most of the work for {{IP-user other}}, while {{IP-user other}} itself does parameter preprocessing.

For more technical details, see the talk page.

See also

  • v
  • t
  • e
Namespace and pagename-detecting templates
Namespace
Particular
  • Main other
  • Talk other
  • Category other
  • Draft other
  • File other
    • Is Commons
  • Help other
  • Module other
  • Portal other
  • Template other
  • User other
  • Project other
  • Single namespace
  • If talkspace of
More generic
  • Namespace detect
  • Namespace detect showall
  • Main talk other
    • Main talk other flex
  • Talkspace detect
Pagename
When on basepage
Detects and acts according to whether it is on a basepage or on any subpage (that is, a ../.. subpage).
When pagename is
For pattern matching on the pagename.
Module:Page
Can take apart and put together pagenames in several ways.
IP-talk
Returns IP-user talkpage, registered-user talkpage or non-user talkpage.
IP-user other
For detecting IP-user pages.
Subpage other
Pagename has an after-slash part (not in mainspace)
Sandbox other
Page is subpage /sandbox (template space)
Testcases other
Page is subpage /testcases (template space)
Rootpage other
Page is rootpage (vs. /subpage) (template space)
Others
Stub other
Detects whether it is on a page with a stub template or not.
Redirect other
Detects whether it is on a redirect or not.
If preview
Detects whether page is viewed as a preview or not.
If IP
Displays different content to IP users and logged-in users.
If autoconfirmed
Displays different content to autoconfirmed and non-autoconfirmed users.
If extended confirmed
Displays different content to extended confirmed and non-extended confirmed users.
If administrator
Displays content only to admins.
If mobile
Displays different content to mobile users and desktop users.
If dark
Displays different content to dark mode users and light mode users.
Noscript
Detects whether page is viewed with a JavaScript-capable client or not.
  • Wikipedia:Namespace
  • Wikipedia:Page name
  • Magic words
  • ParserFunctions
The above documentation is transcluded from Template:IP-user other/doc. (edit | history)
Editors can experiment in this template's sandbox (edit | diff) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Template:IP-user_other&oldid=1304295232"
Last edited on 5 August 2025, at 04:49

Languages

    • ಕನ್ನಡ
    • Svenska
    • Tiếng Việt
    • 中文
    Wikipedia
    • Wikimedia Foundation
    • Powered by MediaWiki
    • This page was last edited on 5 August 2025, at 04:49 (UTC).
    • Content is available under CC BY-SA 4.0 unless otherwise noted.
    • Privacy policy
    • About Wikipedia
    • Disclaimers
    • Contact Wikipedia
    • Code of Conduct
    • Developers
    • Statistics
    • Cookie statement
    • Terms of Use
    • Desktop