0

I have a book with few children article nodes. I would like to create a navigation block tree, that can be placed anywhere on page.

Problem: Normally if I place book navigation block using context (on book and article content type) - the menu shows all links with the link to main book. However, if I try to print inside tpl.php like this

$block = module_invoke('book', 'block_view', 'navigation');
print render($block['content']);

The menu shows only child items. How to show the parent book as well?

2

This code worked for me:

$blockObject = block_load('book', 'navigation');
    $block = _block_get_renderable_array(_block_render_blocks(array($blockObject)));
    $output = drupal_render($block);
    print $output;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.