Template:IfMobile
Jump to navigation
Jump to search
Template documentation
|
---|
Note: portions of the template sample may not be visible without values provided. |
View or edit this documentation. (About template documentation) |
Editors can experiment in this template's sandbox and test case pages. |
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
- {{IfDesktop}}