Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Better handling of episode beginnings #159

Open
amandavisconti opened this issue Jul 9, 2015 · 0 comments
Open

Better handling of episode beginnings #159

amandavisconti opened this issue Jul 9, 2015 · 0 comments

Comments

@amandavisconti
Copy link
Owner

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']='';
    }
    }

@amandavisconti amandavisconti added this to the Out of scope milestone Jul 9, 2015
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant