Get book bid to display at search results page I'm trying to tweak my search results template to include the book root title at the bottom of every search results snippet. I have several books with very similar titles and content and i'd like to be able to print title of the book below each search result snippet so users know what they're going to get when they click search result.

I tried simply print $node->book['bid'] but it didn't print any result. I think it's because i have to somehow get the bid of a snippet and i'm getting bid of search results page which has no bid.

Am i right? And how i do that? I'm using Custom Search module to display my search results.
The book id bid is nothing more then the node id nid of the parent. Therefor if you have the bid, you still need to extract the title from the parent node.

$search_hit = $variables['result']['node']-&gt;nid; // The node id of the search result item
$node = node_load($search_hit); // Load the whole node whose search result we got
$parent_id = $node-&gt;book['bid']; // Extract the parent from the found node

$node2 = node_load($parent_id); // Load the parent node.
echo $node2-&gt;title; // This is the parent title.