By dtabach on
What piece of code (if any) would allow me to display the complete teasers of child pages instead of their titles only, when viewing a parent book-page?
I'd like to have this behavior in some book-pages, not all of them. So I suppose I'll need to make a copy the book.module and do the hacking in the new module.
Any help would be greatly appreciated.
Comments
Try it in the theme
Before starting to hack the module itself, try manipulating this through the theme. As I'm sure you know, you have a lot of power through theming.
pseudo-code:
print node->teaser
or something like that :)
HTH
/elfur.is
Thanks, elfur, for the tip.
Thanks, elfur, for the tip. Could you detail it a bit?
From my readings I understand the steps are these:
Beyond this point, I'm stuck. I guess I should replace the
<?php print $content?>part of node-book-teasers.tplp.php by something else? But what? Or are the child-pages' titles inside the<?php print $links?>part???Durval Tabach
Durval Tabach
Use the excerpt module for the teasers
It's not really a hack of the module, when you do it in you theme :)
I don't think it should be that difficult at all, but I might be wrong.
First you use the excerpt module for the teasers, to control better the text of the teasers.
then, because you say you only want to display this sometimes, you wrap the $content variable in an if/else condition:
What you need to do is figure out what aspects of the $content variable you need to publish the subpage list and their teasers.
That information you might find in the book module itself - or other forum topics.
HTH
/elfur.is
the solution
the solution, for those who might be interested, was to hide the child-pages list using CSS, and then show the wanted teasers by any other means, such as PHP snippets or the Views module. Fortunately, the child pages are 'taxonomized' and may be well filtered by taxonomy.
Durval Tabach