Topic on Extension talk:MobileFrontend

Hiding content on desktop devices

7
178.42.89.242 (talkcontribs)

Hi,

Is there any possibility to hide some parts of content for desktop devices but still keep them visible for mobile devices? I mean something like nomobile class but regarding to desktop (it may be called nodesktop class in this situation).

Greetings, Von Wafeln

Florianschmidtwelzow (talkcontribs)

Only personal interest: What should this be used for? The goal should be to bring the same content to all devices, so the best way is, to don't special handle some device categories :)

There is no way to do this out of the box, iirc. But it's possible that you create your own class. Just edit MediaWiki:Common.css and add:

.onlymobile {
display:none;
}

Common.css will not be loaded in MobileFrontend, so the content is visible on mobile devices using MobileFrontend, but hidden on desktop deveices.

178.42.61.206 (talkcontribs)

Thanks a lot. I would like to use it to display on both groups of devices different user manuals. Maybe it's unnecessary, but I just learned something new, that I could use in any upcoming situation :)

Florianschmidtwelzow (talkcontribs)

Maybe is a better solution to create two seperate manual pages (and link them)? Maybe as subpages of the manual page itself. So your users have the chance to see the content from every device (e.g. if i want to read the manual at my pc to follow the steps at my smartphone) :)

83.28.131.109 (talkcontribs)

Sure, I've created two separate pages and wanted to make visible links for different devices on main page. Well thats good point I have to think about it :)

Florianschmidtwelzow (talkcontribs)

Maybe the better solution is to label the links (e.g.

Desktop browsers: Helplink
Mobile browsers: Helplinkmobile

instead of hiding content :)

Reply to "Hiding content on desktop devices"