Created
May 28, 2013 12:29
-
-
Save ukw-snippets/5662414 to your computer and use it in GitHub Desktop.
set template based on node field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function mytheme_alpha_preprocess_node(&$variables) { | |
if ($variables['type'] == 'webform') { | |
if ($variables['field_form_type'][0]['value'] == 'contact'){ | |
$variables['theme_hook_suggestions'][] = 'node__webform__contact'; | |
} | |
else if($variables['field_form_type'][0]['value'] == 'request'){ | |
$variables['theme_hook_suggestions'][] = 'node__webform__request'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment