As we're starting to migrate functionality provided by the MobileFrontend
extension into Mediawiki core, we have to grapple with some existing
limitations in Mediawiki. I'd like to propose a core change that I think
will greatly increase MW's flexibility in rendering content for different
'view types'. By 'view type', I mean things like:
* The standard web browser view
* A print view
* A mobile view
* Other device specific views, views for particularly slow connections,
views with no graphics, etc.
We could use the idea of a 'view type' to allow us to do some cool stuff,
for instance:
*Dynamic view-specific skin loading*
MobileFrontend already displays content from a mobile-specific skin. We
could make it possible for Mediawiki to dynamically determine the skin to
load based off of the current view type, and provide a pattern for skin
authors to follow for building view type-specific skins, for example:
* Standard: <SkinName>.php
* Print: <SkinName>Print.php
* Mobile: <SkinName>Mobile.php
We could also provide a hook for people to be able to define their own view
types, as well as allow for configuration to define default skins for
specific view types. We could then more easily build view types for
specific devices, for instance. This would greatly lower the barrier of
entry for someone who wants to write a mobile-specific skin, print-specific
skin, etc, and would enrich the pool of available MW skins.
*View-specific functionality*
Different view types will likely have different bits of functionality that
they require, separate from the rest of MW, that may not make sense to
exist in a Skin. We could allow different view types the opportunity to
bootstrap view-specific functionality when appropriate. If we segment this
functionality to only load for a specific view-type, we can prevent
unnecessary components from loading if they are not appropriate for a
specific view. I haven't yet really flushed this concept out, and am very
open to suggestions on implementation.
*
*
I started hacking a bit at a few core files to give a code example of how
this might be implemented, at least for dynamically loading view-specific
skins:
http://pastie.org/4010775
I'd love to hear people's thoughts on this and integrate feedback as we
move forward with migrating MobileFrontend into MW core. Fore more info on
the MobileFrontend to core migration, see
http://www.mediawiki.org/wiki/Mobile_support_in_MediaWiki_core
--
Arthur Richards
Software Engineer, Mobile
[[User:Awjrichards]]
IRC: awjr
+1-415-839-6885 x6687