[NO LONGER MAINTAINED] The latest code related to InfiniteUlysses.com. See instead github.com/amandavisconti/infinite-ulysses-dissertation if you want the repo as it was when I completed the related dissertation.
Instead of separate "episode title" pages, hide these book parent pages and find some other way of signaling beginning of new chapter on appropriate pages.
/**
This preprocess hook avoids the top-level page of a book to be displayed.
Instead, if the top-level book is being requested, user is redirected to
the first child page.
This only occurs if user does not have outline permission.
Also on the first child page, prev link to the top-level page is removed.
*/
function radix_preprocess_book_navigation(&$variables) {
template_preprocess_book_navigation($variables);
// redirect to first child for all users
if($variables['current_depth']==1) {
$first_child_link = book_next($variables['book_link']);
if($first_child_link['link_path']) {
drupal_goto($first_child_link['link_path'],array(),301);
}
}
// Remove prev link for first child
// and remove up link for first level children
if($variables['current_depth']==2) {
if($variables['parent_url'] == $variables['prev_url']) $variables['prev_url']='';
$variables['parent_url']='';
}
}
Instead of separate "episode title" pages, hide these book parent pages and find some other way of signaling beginning of new chapter on appropriate pages.
/**
Also on the first child page, prev link to the top-level page is removed. */
function radix_preprocess_book_navigation(&$variables) { template_preprocess_book_navigation($variables);
// redirect to first child for all users if($variables['current_depth']==1) { $first_child_link = book_next($variables['book_link']); if($first_child_link['link_path']) { drupal_goto($first_child_link['link_path'],array(),301); } } // Remove prev link for first child // and remove up link for first level children if($variables['current_depth']==2) { if($variables['parent_url'] == $variables['prev_url']) $variables['prev_url']=''; $variables['parent_url']=''; } }