Journey through creating Next/Previous links that look like book navigation

  • Playing with the code:

    Put this function in the module:

    function dgd7glue_theme_registry_alter($theme_registry) {
    drush cc all

    and reload the page.

    Presents us with:
    array (
    'template' => 'book-navigation',
    'path' => 'sites/default/themes/apress/templates',
    'type' => 'theme_engine',
    'theme path' => 'sites/default/themes/apress',
    'variables' =>
    array (
    'book_link' => NULL,
    'preprocess functions' =>
    array (
    0 => 'template_preprocess',
    1 => 'template_preprocess_book_navigation',
    2 => 'contextual_preprocess',
    'process functions' =>
    array (
    0 => 'template_process',
    1 => 'rdf_process',

    We could do an if ($book_navigation['preprocess functions'])

    Asking in IRC:

    10:40 mlncn: is it possible to override a preprocess function for a particular theming function / template suggestion? That is, I’m calling theme('example__specialcase'), and I’d like to cancel the usual call of template_preprocess_example()
    12:29 mlncn: what i am trying to do is reuse the book-navigation.tpl.php, but not template_preprocess_book_navigation() which does all kinds of crazy stuff. So i can define my own hook function, and define the path to book module