Questions from a newbie

hunthunthunt's picture

I am building a site constructed using a number of books (books module) for each section.  Each section has about 20 - 30 pages. On some of these book pages I would like to display a particular node. At present i am doing this with the following code contained in the page.tpl.php file: 

 <?php if ($title == "About Us Book") {                
                displayFlexinode("flexinode-7");
                }
                
 ?>

Although this works, it is not ideal, as the page.tpl.php is becoming a mess. I'm aware i need to move away from flexinode - should i be using CCK instead? If not, what can you suggest?

Therefore, is there a way of controlling what nodes appear on what pages of the book?

Also, as there are multiple versions (iterations) of a node, can you control wich one is to be shown?

Many thanks for advice.

 regards,

 

Anthony Hunt 

 

 

 

 

 

hunthunthunt's picture

I found a way of doing it

I pulled apart someone else's script and found that the following will do the job:

<?php 

print node_view(node_load(array('nid' => 119)), 1); 

?>

NB: Where 119 is the nid in the database for the node table.

Still not that neat as it requires looking at the database, still appreciate suggestions.

Thanks,

Anthony

 

 

 

 

greenman's picture

You will need to look at the

You will need to look at the database no matter what. I had expected there to be a filter for this, but there is nothing officially released. 

I think you are doing it the right way.