sorry it's no a proper patch file ... I just added the <span class="print"> and </span> tags ...

<?php
/**
 * Return a themed printable link.
 */
function theme_printable_link($url) {
  $output = '<span class="print">';
  $output .= l(t('printable page'), 'printable/'. $url);
  $output .= '</span>';
  return $output;
}
?>

Is this the best way to do it?

Comments

nedjo’s picture

Status: Needs review » Fixed

Thanks, applied. I changed the class from "print" to "printable" to reduce the liklihood of colliding with another uses.

JohnG-1’s picture

print.module used "print" - just means anyone switching over doesn't have to re-edit any related css ;)

JohnG-1’s picture

Status: Fixed » Needs review

Nedjo - I've finally figured out how to do this the proper drupal way (so it's consistent with comment_add, etc links):

<?php
/**
 * Return a themed printable link.
 */
function theme_printable_link($url) {
  $output = l(t('printable page'), 'printable/'. $url, array('title' => t('Go to printer friendly version of this page'), 'class' => 'printable_link'));
  return $output;
  }
?>

note that HTML output looks like this:

<a href="/drupal5/printable/node/3" title="Go to printer friendly version of this page" class="printable_link">printable page</a>

I've changed the css tag (again!) to "printable_link" so you might like to reference it like so from your printable.css:

.printable_link a {
   display: none;
}

or whatever :)
now if I can just get my damn browser cache to clear properly ...

JohnG-1’s picture

correction to previous post : css reference should be:

a.printable_link {
   display: none;
}

sorry

nedjo’s picture

Thanks, I'll apply this revised patch when I get a chance.

jcnventura’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

This module is no longer maintained. Closing the issue.

Project: » Lost & found issues

This issue’s project has disappeared. Most likely, it was a sandbox project, which can be deleted by its maintainer. See the Lost & found issues project page for more details. (The missing project ID was 111526)