Dear courtney,
thanks a lot. this is exactly what i a looking for. But when i copied
the code to my template, it is complaining about an undefined function.
See the message below:
Fatal error: Call to undefined function:
book_custom_navigation() in D:\My
Documents\blogs\chintha\html\drupal\themes\chintha_css\page.tpl.php
on line 95
Is this a function written by you? Can you please post that too...
thanks,
Paul
courtney miller wrote:
Hi
Paul,
I've done something similar here: http://www.easst.net. The 'Review'
at the top center of the page is using the Books module.
//check for front page
if ($_GET["q"] == variable_get("site_frontpage", "node")){
//return only parent book items (0) and order by desc to get most
recent
$result = db_query("SELECT n.nid FROM {node} n INNER JOIN {book} b ON
n.nid = b.nid WHERE b.parent = 0 AND n.status = 1 AND (n.moderate = 0
OR n.revisions IS NOT NULL) ORDER BY n.created DESC, n.title");
$page = db_fetch_object($result);
// load the node:
$node = node_load(array("nid" => $page->nid));
if ($node) {
// take the most recent approved revision, extract the page and
check output:
$node = book_content($node);
// book_custom_navigation is a custom fuction that does the
same thing as book_navigation, but leaves off the nav prev/next area
$node = book_custom_navigation($node);
$output .= '<div class="node"><fieldset><legend>'
. l($node->title, "node/$node->nid") .'</legend><div
class="bookfront">' . $node->body .
'</div></fieldset></div>';
}
}
Hope this helps,
Courtney
Steven Wittens wrote:
Paul schreef:
Hi,
I think the mailing list is a better place to ask questions than the
drupal forum. Thanks for all the effort in answering the doubts.
I have a website running on drupal, http://www.chintha.com
I am using the book module to publish a monthly magazine. Now i want to
display the current moths magazine table of contents to appear in the
front page. Is it possible? Any php code snippet is greatly
appreciated.
You should be able to do this easily by taking the code from the book
block. Check the function book_block() in book.module.
Steven Wittens
|
--
[ Drupal support list | http://lists.drupal.org/ ]
|
Try Searching:
servers, voip, java, networking, microsoft ...
|
|
|
|