How to change the View Mode based on theme? I am using the ThemeKey module to change the theme for mobile users. I have a custom View Mode called Mobile to display different content. I would like to have when my mobile theme is loaded for the node to use the Mobile View Mode that I created instead of the Default View Mode.

I would like to do this in the theme. Either hooking into the theme with a module or just placing the php in a template override.

Thanks!



Ok 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.

&lt;?php
$rendered_teaser = render(node_view(node_load($nid), 'teaser'));
?&gt;


By using the node number I am able to get it to print in the page.tpl.php file fine. But I am wanting to get the node I am on and convert the view mode from full to teaser.

&lt;?php
$rendered_teaser = render(node_view(node_load(2), 'teaser'));
?&gt;


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.

http://drupal.org/node/985022
http://drupal.stackexchange.com/questions/36028/getting-the-auto-summary-from-a-node-bodyhttp://drupal.stackexchange.com/questions/23961/print-result-of-a-node-load



And I got it working. Any comments appreciated. I placed this on the top of the page.tpl.php. 

&lt;?php 
$nid = $node-&gt;nid;
if ($nid) {
 $nid = $node-&gt;nid;
 $rendered_view = node_view(node_load($nid), 'teaser');
} 
?&gt;


And I placed the print rendered_teaser where I wanted the node view to be printed.

&lt;?php 
if ($nid) {
 print render($rendered_view);
} 
 else {
  print render($page['content']);
 }
?&gt;
Since your mobile theme is a different theme a viable alternative is to just use the same display modes everywhere and then theme that display mode differently by overriding the node.tpl.php file differently in each theme.