You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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']='';
}
}
The text was updated successfully, but these errors were encountered:
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']='';
}
}
The text was updated successfully, but these errors were encountered: