Skip to content

Instantly share code, notes, and snippets.

@jdvc
Created August 26, 2015 22:50
Show Gist options
  • Save jdvc/ebf9d2e8609a673dde6f to your computer and use it in GitHub Desktop.
Save jdvc/ebf9d2e8609a673dde6f to your computer and use it in GitHub Desktop.
<?php
function template_preprocess_ccs_brands_vhp_action_menu(&$vars) {
$element = $vars['element'];
$node = $element['#object'];
$vars['node'] = $node;
$vars['action_menu_items'] = $node->vhp['data']['action_menu_styling']['am_container']['item'];
if(isset($vars['action_menu_items'])){
foreach($vars['action_menu_items'] as $items => $order){
foreach($order as $key => $values){
if(isset($values)){
if($key == 'image'){
$image = file_load($values);
if (is_object($image)) {
$image_vars = array(
'path' => $image->uri,
// TODO: removing to get rid of warnings fix this
// 'alt' => $vars['key'],
// 'title' => $vars['key'],
'attributes' => array(),
);
$vars['action_menu_items'][$items]['image'] = theme_image($image_vars);
}
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment