With this mod installed book pages have redundant print links.

Comments

km’s picture

Assigned: Unassigned » km

Should be easy to fix.

km’s picture

The print.module won't show "printer friendly" links on book pages no more.

dublin drupaller’s picture

Version: 4.5.x-1.x-dev » 4.6.x-1.x-dev
Status: Closed (fixed) » Active

the 4.6.0 version does show double links on book pages.

dub

Cromicon’s picture

Any fix on this yet? Great module!

Cromicon’s picture

/**
 * Implementation of hook_link().
 */
function print_link($type, $node = 0, $main) {
  $links = array();

  if ($node->type == 'book' && function_exists('book_link'))  {
    return;
  }

  if ($type == 'node' && variable_get('print_show_link', 1) && $main == 0) {
    $links[] = theme('print_link', $node);
  }

  return $links;
}

Anything to do with that code? My books are blogs converted to book via outline would that make a difference?
ps lastest download of 4.6 used

Cromicon’s picture

apologies for multiposting

I prefer this modules output for book pages, core pf output is untidy. any way of disabling the core print friendly link instead?

Cromicon’s picture

disabling core print friendly output was easy after all, although you will have to keep track of this change if ever you need to upgrade or reinstall drupal.

in book.module find this code:

/**
 * Implementation of hook_link().
 */
function book_link($type, $node = 0, $main = 0) {

  $links = array();

  if ($type == 'node' && isset($node->parent)) {
    if (!$main) {
      if (book_access('create', $node)) {
        $links[] = l(t('add child page'), "node/add/book/parent/$node->nid");
      }
      $links[] = l(t('printer-friendly version'), 'book/print/'. $node->nid, array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')));
    }
  }

  return $links;
}

and simply comment out $links[] = l(t('printer-friendly version'), 'book/print/'. $node->nid, array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')));

as so:
// $links[] = l(t('printer-friendly version'), 'book/print/'. $node->nid, array('title' => t('Show a printer-friendly version of this book page and its sub-pages.')));

jcnventura’s picture

Status: Active » Closed (fixed)

PFP 4.6 is no longer supported.