Template:IfMobile

From Sun Haven Wiki
Jump to navigation Jump to search
float Template documentation[View] [Edit] [History] - [Sandbox] [Refresh]
===Description===

A simple if statement for detecting if the page is being displayed in mobile mode. This can be useful for getting around some of the limitations of mobile view by have 2 different bits of code for the 2 different views.

Note: Any desired use of = or | in the parameters will need to be replaced with {{=}} or {{!}} respectfully.

Syntax

{{ifMobile|<1>|<2>}}
1
Code block to use for Mobile Mode viewers.
2
Code block to use for Desktop Mode viewers.

Sample

* {{ifMobile|mobile code}}
* {{ifMobile|mobile code|desktop code}}

results in

  • desktop code


See also

See the articles and the templates currently using this template.