Difference between revisions of "Template:If mobile/doc"
imported>Sdkb (added navbox) |
imported>Evad37 (→Usage: make not more obvious, since it is confusing otherwise) |
||
| (One intermediate revision by one other user not shown) | |||
| Line 13: | Line 13: | ||
:E.g. {{para|tag|div}} can be used if the content contains block-level elements. | :E.g. {{para|tag|div}} can be used if the content contains block-level elements. | ||
| − | Note that | + | {{info|Note that {{tlx|If mobile}} only works outside of the Template: namespace.}} |
==Example== | ==Example== | ||
| Line 20: | Line 20: | ||
* [https://en.m.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&oldid=857234029 view on mobile website] | * [https://en.m.wikipedia.org/w/index.php?title=Wikipedia:Sandbox&oldid=857234029 view on mobile website] | ||
| − | {{Namespace and pagename-detecting templates}} | + | {{Namespace and pagename-detecting templates|state=collapsed}} |
<includeonly>{{sandbox other|| | <includeonly>{{sandbox other|| | ||
Latest revision as of 00:29, 24 December 2020
| 40px | This is a documentation subpage for Template:If mobile. It contains usage information, categories and other content that is not part of the original template page. |
Script error: No such module "Uses TemplateStyles". This template detects whether it is being used on the mobile version of Wikipedia (en.m.wikipedia.org), and displays different content accordingly.
Rationale
Some features work differently on the mobile website, such as slideshow galleries appearing as ordinary galleries. This templates 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.
Usage
{{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=divcan be used if the content contains block-level elements.
| 40x40px | Note that {{If mobile}} only works outside of the Template: namespace. |
Example
{{If mobile|A mobile user you are!|You are looking at the desktop site}}