I've tried $node->content['body']['#value']
but only typed in by user content is shown, no navigational divs. Sad, it'd be nice to have contemplates and book working together.
I have experienced the same problem. I want to assign template to node fields only, but I have to write the book navigation in it too, or the book navigation won't be shown.
By default, node's content is compilation of it's child elements. Book navigation is one of them. This makes me free to changed template, but also makes contemplate not flexible. So, I write a little hack to display my new template:
<?php
ob_start();
// ... Your template here..
$node->content['body']['#value'] = ob_get_contents();
ob_end_clean();
// iterate through each child elements
foreach (element_children($node->content) as $key) {
// we skip child elements which name preceeded by 'field_'
if (substr($key, 0, 6) == 'field_') continue;
// print child element
print $node->content[$key]['#value'];
}
?>
This will works for other child elements such as fivestar rating.
Comments
Comment #1
tonticologo commentedI've tried
$node->content['body']['#value']but only typed in by user content is shown, no navigational divs. Sad, it'd be nice to have contemplates and book working together.
Comment #2
gantenx commentedI have experienced the same problem. I want to assign template to node fields only, but I have to write the book navigation in it too, or the book navigation won't be shown.
By default, node's content is compilation of it's child elements. Book navigation is one of them. This makes me free to changed template, but also makes contemplate not flexible. So, I write a little hack to display my new template:
This will works for other child elements such as fivestar rating.