[documentation] general handbooks question

Laura Scott laura at pingv.com
Tue Jun 13 19:44:24 UTC 2006


Thanks, Neil! I've passed the message on. Much appreciated!

Laura

On Jun 13, 2006, at 1:05 PM, Neil Drumm wrote:

> Laura Scott wrote:
>> I have a client who's looking to create documentation (for their own
>> products) using the books module, who is wondering how the main
>> handbooks sections pages have been set up. Is this done via php  
>> calls or
>> manually? I'm assuming that each major section is its own book --  
>> hence
>> the changing navigation block, right? -- with that book's top  
>> level page
>> using custom php calls, yes?
>
> <?php
> // Book nids and their titles
> $books = array(1 => "About Drupal", 258 => "Installation and
> configuration", 257 => "Customization and theming", 316 => "Developing
> for Drupal", 14279 => "About Drupal documentation");
>
> foreach ($books as $nid => $title) {
>   print '<h2 style="clear: left;">'. l($title, 'node/'. $nid) .'</ 
> h2>';
>   // Fetch first level children
>   $result = db_query("SELECT DISTINCT b.nid, n.title FROM {book} b  
> INNER
> JOIN {node} n ON b.vid = n.vid WHERE b.parent = %d AND n.moderate = 0
> AND n.status = 1 ORDER BY b.weight ASC", $nid);
>
>   // Output pretty two-column list
>   $half = ceil(db_num_rows($result) / 2); $i = 0;
>   $section = '<div class="column-left"><ul>';
>   while ($page = db_fetch_object($result)) {
>     $section .= '<li>'. l($page->title, 'node/'. $page->nid) .'</li>';
>     $i++;
>     if ($i == $half) {
>       $section .= '</ul></div><div class="column-right"><ul>';
>     }
>   }
>   $section .= '</ul></div>';
>   print $section;
> }
> ?>
>
> The rest is CSS.
>
> (I'm guessing this is something that might be able to be coded into a
> view in views module.)
>
> -- 
> Neil Drumm
> http://delocalizedham.com/
> --
> Pending work: http://drupal.org/project/issues/documentation/
> List archives: http://lists.drupal.org/pipermail/documentation/



More information about the documentation mailing list