Template:IfMobile/doc

From Immortal Life Wiki
Jump to navigation Jump to search

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