Most book pages are parents and children of some other pages at the same time.
If by "not parent pages" you mean "not the top book page", then you can create a copy of node.tpl.php, name it node-book.tpl.php, edit it and put in it:
if ($node->book['depth'] > 1) {
print $thestuff;
}
If by "not parent pages" you mean "not pages which have any children", then
if ($node->book['has_children'] = 0) {
print $thestuff;
}
Unfortunately, none of those worked. I'm trying to add something to the left of the content in all book pages, except the top book page. I tried adding a block, but the content block gets added to the foot of the content and I need it to the left of the content (not in the left side bar though).
That code can work only after loading the $node that you want to check. In a node template it is probably already loaded, but in a block or in the content it isn't.
Thank-you for your help. I've just discovered PHP template regions and I've accomplished what I wanted by adding a custom region to my template. I added a block to that region and let Drupal's block filters handle everything.
Comments
.
Parent/child pages? You mean in a book structure? Or in a menu?
And where is your code? Inside the pages? In a theme template? In a block?
Yes, this is for book-type
Yes, this is for book-type nodes. I'm trying to put the code in a template.
.
Most book pages are parents and children of some other pages at the same time.
If by "not parent pages" you mean "not the top book page", then you can create a copy of node.tpl.php, name it node-book.tpl.php, edit it and put in it:
If by "not parent pages" you mean "not pages which have any children", then
Unfortunately, none of those
Unfortunately, none of those worked. I'm trying to add something to the left of the content in all book pages, except the top book page. I tried adding a block, but the content block gets added to the foot of the content and I need it to the left of the content (not in the left side bar though).
I'm running Drupal 5.22 .
.
That code can work only after loading the $node that you want to check. In a node template it is probably already loaded, but in a block or in the content it isn't.
Thank-you for your help. I've
Thank-you for your help. I've just discovered PHP template regions and I've accomplished what I wanted by adding a custom region to my template. I added a block to that region and let Drupal's block filters handle everything.