[support] drupal 7 change page.tpl based on value in CCK

Hummel, Tracey S - (thummel) thummel at email.arizona.edu
Wed Jun 13 19:47:49 UTC 2012


In drupal 7, I'd like to be able to change the page template if a value is returned in a CKK field.

I tried:

function themename_preprocess_page(&$variables) {
      $node =  $variables['node'];
      if($node->type == 'page') {
           if (isset($node->field_change_theme['und']['0']['value'])) {
                   $variables['theme_hook_suggestions'][] =  'page__newtheme.tpl.php';
          }
     }
}

A value is being returned but the theme is not changed.   Please help.

Thanks,
Tracey

--------------------
Tracey Hummel
Web Application Developer
SBS Technical Services
University Services Building
tracey at arizona.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20120613/501d1700/attachment.html 


More information about the support mailing list