Template talk:Mobile only

From Wikivoyage
Latest comment: 2 years ago by Pbsouthwood
Jump to navigation Jump to search

Purpose is also explained in the documentation.

Template:Mobile only is used to cause a block of content in Wiki markup which is included as the parameter to display only on the mobile site. It should be invisible in desktop view. Mobile only can be used with Template:Desktop only to display alternative content depending on whether the user is viewing from desktop or mobile view, or on its own where the content is not needed on desktop view. This can be useful when the content does not render correctly on both platforms due to software problems, some of which have been known for years and may never be fixed. It may also be useful for other things, like adding this functionality to other templates, though in some cases wrapping in span tags may be more appropriate.

Syntax is: {{Mobile only|1=(block of content)}}

The template wraps the content in division tags with class="mf-mobile-only", which is in Wikivoyage's MediaWiki:Common.css

This class is set as "display:none"

Cheers, Peter (Southwood) (talk): 15:04, 25 March 2022 (UTC)Reply