Difference between revisions of "Template:If mobile"

From blackwiki
Jump to navigation Jump to search
imported>Pseudo Classes
(This edit imported from Template:If mobile is powered by Duplicator Premium.)
imported>Evad37
(@User:Sdkb: No point in having noincludes, this only works outside of the Template: namespace)
 
(4 intermediate revisions by one other user not shown)
(No difference)

Latest revision as of 00:27, 24 December 2020

50px Template documentation[view] [edit] [history] [purge]

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=div can be used if the content contains block-level elements.

Example

{{If mobile|A mobile user you are!|You are looking at the desktop site}}