function cms_portfolio_preprocess_node in Glazed CMS Portfolio 7
Same name and namespace in other branches
- 8 cms_portfolio.module \cms_portfolio_preprocess_node()
Implements template_preprocess_node()
File
- ./
cms_portfolio.module, line 47
Code
function cms_portfolio_preprocess_node(&$vars) {
if ($vars['type'] == 'portfolio') {
$layout = 'top';
if (!empty($vars['field_project_details_layout'])) {
$layout = $vars['field_project_details_layout']['und'][0]['value'];
}
elseif (theme_get_setting('portfolio_details')) {
$layout = theme_get_setting('portfolio_details');
}
$vars['classes_array'][] = 'node-details-' . $layout;
$sidebar = '4';
if (!empty($vars['field_project_sidebar'])) {
$sidebar = $vars['field_project_sidebar']['und'][0]['value'];
}
elseif (theme_get_setting('portfolio_sidebar')) {
$sidebar = theme_get_setting('portfolio_sidebar');
}
$vars['attributes_array']['data-sidebar'] = $sidebar;
$vars['attributes_array']['data-main'] = 12 - $sidebar;
$style = 'sidecaption';
if (!empty($vars['field_image_display_style'])) {
$style = $vars['field_image_display_style']['und'][0]['value'];
}
elseif (theme_get_setting('portfolio_images')) {
$style = theme_get_setting('portfolio_images');
}
$vars['classes_array'][] = 'node-images-' . $style;
}
}