Home ›
Capturing Menu Block configuration in code with hook_menu_block_blocks()Capturing Menu Block configuration in code with hook_menu_block_blocks()
Submitted by Benjamin Melançon on September 5, 2011 - 2:36pm
<?php
/**
* Implements hook_menu_block_blocks().
*/
function feature_about_menu_block_blocks() {
$nid = variable_get('sdl_about_daniel_nid', 18);
$pmlid = db_query('SELECT mlid FROM {menu_links} WHERE link_path = :link_path AND module = :module', array(':link_path' => 'node/' . $nid, ':module' => 'book'))->fetchField();
// The array key is the block delta used by menu block.
return array(
'feature_about-1' => array(
'menu_name' => 'book-toc-' . $nid,
'parent_mlid' => $pmlid, // variable_get('sdl_about_daniel_parent_mlid', 298),
'title_link' => 0,
'admin_title' => 'About section book navigation menu block',
'level' => 1,
'follow' => 0,
'depth' => 2,
'expanded' => 1,
'sort' => 0,
),
);
}
?>
Comments
Post new comment