Firstly, great little module, I've been needing something simple like this for a while!
After a bit of a test drive the first issue that comes to mind is that Mobile Detect's isMobile() call returns TRUE for tablets as well as traditional handheld mobile devices. This isn't a problem for most of it's existing use cases, as you can chain rules (so that if isMobile() is TRUE and isTablet() is FALSE the mobile version kicks in) - however Views Mobile hardcodes a single check for isMobile() into the module.
Ideally there would be some way of selecting whether tablets should be included when Views Mobile performs the detection/switch. This could be an extension of the '_mobile' namespace, so that users could also use '_tablet' and '_handheld' (Mobile Detect has implemented an isHandheld() check), or a setting page (either globally via admin/config or even better per-view) where users could select what subset of devices should receive the mobile view.
Any thoughts on what the best way to do this would be?
Comments
Comment #2
khalor commentedComment #3
revagomes commentedHi Khalor,
I'm happy that this module helps you.
I've published this module early in order to get feedback from the users and guide the development based on the feedbacks.
If you are familiar with contributing to Drupal, I suggest you to send a patch for this. Otherwise, I'm adding this to the next release. Stay tuned. ;)
Meanwhile you can achieve this by implementing the hook_views_pre_view() and alter the display name to one of your choice. Just as this module does. Don't forget that your custom module must be a weight heavier than views_mobile in order your new hook to run after view_mobile's implementation.
Thanks for the feedback!
Comment #4
jorditr commentedHi, looks a pretty interesting feature missing on Views. Extending the namespace would be a great addition. Thanks!
Comment #5
bluehead commentedVery cool module. Subscribed.
Comment #6
bluehead commentedFollowing code works for tablets and handheld devices
Comment #8
revagomes commentedThanks @bluehead!
It's already added in the next release.
Comment #9
revagomes commented