>
> How can I prevent web2py from rendering the mobile version on an iPad and 
> other tablets. I don't want to disable mobile rendering altogether. It 
> works fine on the iPhone/Android, but I'd like to use the standard full 
> rendering on tablets. Thanks!
>

The responsive grid used in the "welcome" app is simply based on Skeleton 
(http://www.getskeleton.com/), so to change the behavior, you'll have to 
edit the /static/css/skeleton.css file. In particular, comment out the 
Tablet media query section: 
http://code.google.com/p/web2py/source/browse/applications/welcome/static/css/skeleton.css#464.

You might also need to fiddle with the menu in layout.html 
(http://code.google.com/p/web2py/source/browse/applications/welcome/views/layout.html#80),
 
as I believe request.user_agent().is_mobile counts the iPad as a mobile 
device. If you want to conditionally change the menu on the server side, 
you'd have to do your own parsing of request.user_agent() to decide what 
counts as mobile. An alternative is to generate both versions of the menu 
on the server side and use client-side CSS media queries to selectively 
show one and hide the other depending on the screen width.

Note, there's talk of switching the "welcome" app to Twitter Bootstrap 2.0, 
which also has a responsive grid -- if you use that, there would be a 
similar procedure to disable the responsiveness for tablets.

Anthony

Reply via email to