Created
September 23, 2013 14:51
-
-
Save vdchristelle/6671603 to your computer and use it in GitHub Desktop.
Function adds the main-menu items to taxonomy menu block
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 the_aim_theme_preprocess_taxonomy_menu_block(&$variables){ | |
//only for block with delta == 1 | |
if ( 1 == $variables['config']['delta']) { | |
$links = menu_tree('main-menu'); | |
$main_links = array(); | |
foreach ($links as $link) { | |
if(isset($link['#original_link']) && !empty($link['#original_link'])) { | |
$original_link = $link['#original_link']; | |
$main_links[$original_link['mlid']] = array('name'=>$original_link['link_title'], 'path'=> $original_link['link_path'], 'depth'=>0, 'parents'=>array(), 'active_trail'=>'0', 'children'=>array()); | |
} | |
} | |
//switch both arrays in the merge if you want the term links to be appended or prepended | |
$variables['items'] = array_merge($main_links,$variables['items']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment