Closed (fixed)
Project:
Entity view modes
Version:
7.x-1.0-beta3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
31 Aug 2012 at 20:04 UTC
Updated:
11 Feb 2013 at 04:30 UTC
I have a website I am working on that has a normal theme and a mobile theme. When the mobile theme is used I want to use a different View Mode. I just can't figure out how to change the view mode when the mobile theme is used. I was thinking in a PHP template override I could specify the node view mode before being rendered. Either that or a module that checks for the mobile them and changes the view mode of all nodes to the mobile view mode.
Any help would be appreciated.
Thanks!
Comments
Comment #1
poeticninja commentedOk I found a few items that get my closer to what I am needing. I just can't seem to get it to work. I am testing this idea with the teaser for now.
I found that information be reading the links below. I am still not able to get it to work but close. For some reason I get errors. I think it has to do with me placing it in the node.tpl.php and the page.tpl.php template file. Instead of $nid i used node 2 for a test and that worked perfectly. The problem is I need the node I am currently on.
http://drupal.org/node/985022
http://drupal.stackexchange.com/questions/36028/getting-the-auto-summary...
http://drupal.stackexchange.com/questions/23961/print-result-of-a-node-load
Comment #2
poeticninja commentedAnd I got it working. Any comments appreciated. I placed this on the top of the page.tpl.php.
And I placed the print rendered_teaser where I wanted the node view to be printed.
Comment #3
kaizerking commentedIt seems you want to get various page sizes depending on the client mobile or PC or tablet.
If your only concern is that then you can use omega theme, where you can design responsive themes.
initially i didn't know that(I am very bad in in theming).A responsive theme adjusts the design according to the client display system.try it if you are looking for such function
Comment #4
dave reidYou should actually update to the latest version of core and use the new hook_entity_view_mode_alter().