Skip to content

Instantly share code, notes, and snippets.

@rubedell
Created October 21, 2013 13:19
Show Gist options
  • Save rubedell/7083757 to your computer and use it in GitHub Desktop.
Save rubedell/7083757 to your computer and use it in GitHub Desktop.
Combine taxonomy menu + main menu
/**
* Implements template_preprocess_taxonomy_menu_block()
* Adds the main-menu items to this taxonomy menu block
*/
function the_aim_theme_commerce_preprocess_taxonomy_menu_block(&$variables){
//only for block with delta == 1
if ( 1 == $variables['config']['delta']) {
if(isset($variables['items'][-1])) {
$links = menu_tree('main-menu');
foreach ($links as $link) {
if(isset($link['#original_link']) && !empty($link['#original_link'])) {
$original_link = $link['#original_link'];
$variables['items'][$original_link['mlid']] = array('name'=>$original_link['link_title'], 'path'=> drupal_get_path_alias($original_link['link_path']), 'depth'=>0, 'parents'=>array(), 'active_trail'=>'0', 'children'=>array());
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment