Further instructions on the accessibility module pertaining to version 5x of Drupal are listed below. As feedback has brought up the issue of vagueness I thought more details were required to help with the implementation of the module.
The accessibility module, as you should know by now, is a plugin for Drupal CMS that allows restricted content and access to a site. In other words, it allows multiple versions of one site using only one code base - making Drupal mobile and accessible for the masses.
The module does two things. Firstly it includes very basic device detection and also checks for best suited content type. Based on these factors the script then determines which theme to use, the correct content type to send to the browser and break up the content into smaller chunks if required.
There are a number of very important factors to be aware of when trying to install and implement the module. Please take these factors into account!
The module looks for 2 hard-coded (currently) themes, wap and mobi, for hand-held devices. These themes must exist and be enabled for the mobile sites to work correctly. When browsing from a hand-held the module will automatically select the best suited theme available.
An enhancement for the module for version 5 was the possibility to use a standard theme for web browsing. However additional variables are created to modify content type within the HTML accordingly. Prior versions required a theme called web to exist and must be enabled too.
It is highly recommended that you download the theme files available on this site to see the additional page.tpl.php and template.php modifications. Of course, these additions can be incorporated into existing themes as required. See the related links section on this page to get the files. Themes for 4.7 are also available. Note that style.css is blank - edit as required.
Having modified your main theme and wap and mobi themes accordingly upload them to your themes directory and enable them all. Modify any settings per theme as required then you can upload and enable the accessibility module itself. More details of the actual installation and more tips on the template files themselves can be found in the guides section of this site. Particular detail should be paid to the settings information with special attention to the XHTML and application/xhtml+xml content type:
This can break your pages if content is malformed and some JavaScript functions do not work. See this issue raised on the project pages.
Browsing from a mobile device the pages are broken down into chunks using a function based on the paging.module - this is an optional setting. However certain HTML tags are removed in order for pages to display in WML. This particular function is by no means perfect and will hopefully be updated with a new release. Content can be limited on a hand-held by incorporating a mobile user role and the taxonomy_access module for example.
This site uses an out-of-the-box version of the accessibility module, however the themes are heavily modified. If you wish to see the changes that I have made to make this site the way it is please get in touch and I will send you the files and details of the actual changes.
Comments
Bit confusing name
This is still a bit confusing as the term accessibility is mostly used in totally different contexts! Maybe "Mobility" module would be better? Are you based in Kuala Lumpur by the way? I found this site through w3c sites... keep up the good Drupal coding :)
Module Name
Hi Dan, thanks for your comments.
I chose "accessibility" because for me this was a more important factor than mobile enabled. See my thoughts on what is accessibility for more..
To me, a mobility module would make posting from a hand-held a possibility and include some sort of SMS features etc ... the module does not have these features yet!
And yes, I am currently based in Kuala Lumpur, though I return to Finland in April this year :(
Br
Jamie
Making Drupal Mobile
Override
Hi Jamie,
Good work on this module - not tried it out yet but am preparing to trying it on a demo site that I have. Just one question, as I can't seem to find it anywhere, are mobile users still able to access the "actual" site? A lot of sources (e.g. http://mtld.mobi/) suggest that mobile users should always be able to get to the non-mobile version of the site, for instance via a link.
I assume to do this you'd need to let them change their theme to the web theme. I'm not sure if you've considered yet, nor how easy or difficult it may be. I'm still relatively new to Drupal but it's something I will probably have a go at if it's not already implemented.
Thanks!
Steve
Alternative Site
Hi Steve,
Thanks for your inquiry. To answer this:
No, mobile users cannot view the actual site at the moment, but it would be possible to provide an alternative "web" site.
The override can / should take effect by defining
IS_MOBI.You should be able to do this within
settings.php.define ('IS_MOBI', FALSE);This definition could be based on
$_COOKIEor$_SESSIONvariables that you could generate from a form. Though there are obvious problems with the WAP version. However, if a phone could view the full site, then it should be using non-wap anyway. I may well write a short article on how to achieve this in the very near future.I haven't tested this option for quite a while now, but this feature is something that I plan to further develop for Drupal v6!
Any further questions or thoughts, please don't hesitate to get back in touch.
Br
Jamie
Making Drupal Mobile
How to set Number of posts on main page using wml
Dear,
Thanks for your accessibility module.
Normal:
I can set Number of posts on main page via 'Post settings', for example, 10. So there are 10 posts on main or taxonomy page using mobi(Opera browser)
Wml:
But there is just on post on main or taxonomy page using wml(Openwave V7 Simulator)
How can I set number of posts on main page using wml?
Thanks.
What Version Are You Using
Hi, Are you using a 5x variant of the module?
I think, IIRC, that this figure is hard coded in the module files itself.
It is in accessibility.php around line 42. It is the $mime['node'] variable.
WML and XHTML MP should be the same, though you could edit the accessibility_init.php file to override $conf['default_nodes_main'] manually.
HTH.
Br
Jamie
Making Drupal Mobile