Jump to:
| Project: | Mobile Tools |
| Version: | 7.x-2.x-dev |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Hello all,
First of all, great module! I'm a big fan. I have a question, though, about how one would go about making "mobile-aware" views-- or maybe one would say "context-aware" views. Here's what I mean: it's easy, though the Mobile Tools' integration with Drupal's theming layer and Fields system, to modify node displays (e.g. turning fields on and off) and blocks, thus simplifying the interface for a mobile user.
However, I haven't been able to figure out how to create Views with the same flexibility. Here's a use-case: on your desktop site, you have a page for your portfolio at http://www.example.com/portfolio, and you want to use that same URL for mobile, at http://m.example.com/portfolio. In both cases, the path "/portfolio" is a View, but for the mobile version of the site, you want to show fewer fields to simplify the user experience on mobile.
I guess there are ways to do this by either outputting your Views as blocks, and then turning those blocks on and off, or conversely using Panels and Context. But both ways seem like extra work, especially if you have an existing site with existing Views, and besides, Panels is a heavy module and I don't like to use it unless it's necessary.
I'm imagining something like a system where 2 Views could have the same path, but would only display under certain conditions-- i.e. either in a particular theme or for particular devices (as defined by Mobile Tools). Conversely, each field could be hidden or shown for certain contexts. Is this already done and I just don't know it?
Thanks!
Nathan
www.visualatte.com
Comments
#1
I forgot to mention before that, of course, one can theme Views (using .tpl.php files) in order to make certain fields display differently, or not show up at all. That would work and be lighter-weight than using Context, Panels, etc.
I just thought, though, it would be nice to go to a particular URL and have "View 1" show up for mobile and "View 2" show up for desktop, etc.
Nathan
#2
Hi,
Interesting question. At this point I know of several ways to represent different views for mobile and desktop :
A. In case of blocks using views, there is the integration with Context to display different views for mobile devices (this functionality is at this point not yet available in the 7.x version)
B. Using Panels (as you also mentioned). You can wrap two views (mobile / desktop) as panel variants in a panel. You can use the Mobile Tools integration with panels to show one of the two variants.
C. When you display full nodes in views ( so no individual fields), you could use build modes. But again, this is still under development for D7...
At this point, I don't see a solution that works within views alone.
Let me know if you have any solutions that fit your case!
#3
I just wanted to add another use-case to this conversation - views display type. There are a number of displays (jquery carousel, grid, etc.) that may not be appropriate for mobile, and aren't set up in a template file.
Yours and the OP's idea of using Panels would solve this, as two view displays could be created.
And, that might really be the best way to handle it - a person might create a view called, "Portfolio" (per OP's example) and then create an alternate view called "Portfolio-Mobile". Then you can tweak each view according to the requirements they'd each need. That way, it's not just showing or hiding via a template file, but you're really tailoring the experience for mobile and desktop.
#4
I'm extremely interested in this type of functionality as I have a site for a client who wants to display only one section of the site differently for mobile users (wants the section to look like a mobile app). I'm having a really hard time getting Mobile Tools to switch the theme in that section and then switch back to the original (while having a specific mobile URL). Since that whole section is made with Views, it would be nice if there was a way for them to be mobile-aware...
In the meantime, is it even possible to have a section of a site mobile-aware?
#5
interesting for me too ...
#6
What about doing it through Views displays? Mobile Tools is already working with Display Suite.
#7
That sounds like it could work! I'll give it a try
#8
@tevih, let me know if I can help testing (my developing skills are rather scarce I'm afraid) I am using 6.x though
#9
Thanks - I'll give it a try this week