tags:

views:

98

answers:

2

I'm just getting round to converting our static HTML website to Drupal. Our website is currently structured into sections, each section having a header, then a list of sub-sections below (for an example see http://www.eurosafeuk.co.uk/services/).

This ties in very nicely with Drupal's "book" module, but I need to customise the display of child pages; by default they're printed as an unordered list of page titles, whereas what I need is to output:

  • A teaser image for each page
  • The page title
  • The page summary

I've looked through the .tpl files, and found that the children are stored in a $tree variable (already HTML formatted). My question is: where do I start if I want to modify this? Does anyone know of a pre-existing module that would do it, or do I need to dig into the code?

+1  A: 

Instead of using the Book module which is specifically for a book structure, you might want to look into modules that are made for your case. I haven't looked very well but the Node Hierarchy module might be useful for you. http://drupal.org/project/nodehierarchy

If you want to theme nodes in specific sections in different ways, it's probably a good idea to make separate .tpl files for every section. The way you name those .tpl files makes them applicable to nodes in a certain section.

Niels Bom
Bingo! Thanks, that's exactly what I was looking for.
Keith Williams
I've been meaning to look at http://drupal.org/project/menu_block, which looks to be a lighter-weight approach to the same sort of idea.
Grayside
A: 

Get the devel module, and turn on theme developer. This will tell you the template or function which is used to build the HTML and what templates you can create to override it.

Jeremy French

related questions