Note that ((If mobile )) only works outside of the Template: namespace.
This template detects whether it is being used on the mobile version of Wikipedia (en.m.wikipedia.org), and displays different content accordingly.
Some features work differently on the mobile website, such as slideshow galleries appearing as ordinary galleries. This template allows better presentation of such content, by e.g. having a "Slideshow" heading when a slideshow is shown, and a "Gallery" heading when a regular gallery is shown.
((If mobile|content for mobile website |content for desktop website ))
By default, <span>...</span>
tags are used to wrap the specified content. A different tag may be specified using |tag =
E.g. |tag =div
can be used if the content contains block-level elements.
((If mobile|A mobile user you are!|You are looking at the desktop site))
Note that the behaviour is different when within the Template: namespace! (e.g. on this documentation page)
You are currently viewing the ((If mobile|mobile website|desktop website)).
You are currently viewing the desktop website mobile website .
Namespace and pagename-detecting templates
Namespace
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.
Noscript Detects whether page is viewed with a JavaScript-capable client or not.