Last modified: 2014-06-10 20:45:18 UTC
mobile-friendly templates should be easy to create either by having separate desktop and mobile templates, or by providing a means for templates and Scribunto to tell when a person is viewing the website through the mobile front end. This should make redesigning template for mobile use easier because this continues to be a problem as presented in bug #36674 or presented as an alternative solution in bug #53437 and hiding templates based on class isn't a viable long term solution as it can break mobile user's ability to navigate between related pages, or hide important information that even mobile users should know.
Prioritization and scheduling of this bug is tracked on Trello card https://trello.com/c/xn4GbsPV
Would this help? https://www.mediawiki.org/wiki/Requests_for_comment/Allow_styling_in_templates
Jon, I think layout and style separation is a good plan. However sometimes the layout of templates may need to be different between desktop and mobile browsers as well. * compact vs expanded layout * vertical vs horizontal layout * visual vs textual layout * more vs less information * delay vs immediate display Maybe have mw.IsMobile() in Scribunto, and {{#mobile:{{MOBILEUSER}}|mobile layout|desktop layout}} for pure template.
(In reply to darklama from comment #3) > Maybe have mw.IsMobile() in Scribunto, and > {{#mobile:{{MOBILEUSER}}|mobile layout|desktop layout}} > for pure template. No way, this would result in every page being parsed twice: once for mobile and once for desktop. Not acceptable for performance reasons.
(In reply to Max Semenik from comment #4) > (In reply to darklama from comment #3) > > Maybe have mw.IsMobile() in Scribunto, and > > {{#mobile:{{MOBILEUSER}}|mobile layout|desktop layout}} > > for pure template. > > No way, this would result in every page being parsed twice: once for mobile > and once for desktop. Not acceptable for performance reasons. Mobile already uses a different layout, and different skins. Are you suggesting parsing doesn't already happen at least twice when caching the page with different skins, like mobile and vector?
Yes.
Yeh so what Max is getting at is the bit of code that turns wikitext into HTML. This is currently generated on a save. What you are talking about would require 2 versions of the content to be maintained and generated on every save. Currently the mobile skin simply injects the same parser output as desktop into a different layout. What you talk about could be possible for a 3rd party site with lower traffic but not really a Wikimedia sites :-/
Multilingual Wikimedia projects like Meta, Commons, Incubator, etc. often include templates that change with a person's language choice, which requires far more parsing to achieve. Translations are sometimes included within the same template and sometimes using separate pages. How about {{name}} using Mobile_template:Name or Template:Name/mobile for the mobile view?
Yes, and you're proposing to multiply this number by 2.