function unity_lab_preprocess_paragraphs_item_pg_common_card(&$vars, $hook) { $type = empty($vars['field_common_card_type'][0]['value']) ? 'simple_blurb_card' : $vars['field_common_card_type'][0]['value']; $vars['content']['type'] = $type; $vars['column_classes'] = empty($vars['field_column_classes'][0]['value']) ? '' : $vars['field_column_classes'][0]['value']; _unity_lab_paragraphs_item_get_theme_hook_suggestion($vars, __FUNCTION__); $item['css_classes'][] = 'card'; $item['css_classes'][] = 'pg-card'; //$item['item_classes'][] = $vars['content']['type'] . '-card'; $vars['content'] = array_merge($vars['content'], $item); //adds function hooks per bundle type $function = __FUNCTION__ . '_' . $type; if (function_exists($function)) { $function($vars, $hook); } //adds function hooks per bundle type & node type; if (arg(0) == 'node' && is_numeric(arg(1))) { $node = node_load(arg(1)); $function = $function . '__' . $node->type; if (function_exists($function)) { $function($vars, $hook); } } }
function unity_lab_it_preprocess_paragraphs_item_button_section(&$vars, $hook) { $vars['content']['type'] = empty($vars['field_button_section_type'][0]['value']) ? '' : $vars['field_button_section_type'][0]['value']; _unity_lab_paragraphs_item_get_theme_hook_suggestion($vars, __FUNCTION__); _unity_lab_paragraphs_item_column_classes($vars, $vars['content']['links'], 3); }