Closed (fixed)
Project:
Printer, email and PDF versions
Version:
5.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Sep 2007 at 14:29 UTC
Updated:
24 Oct 2007 at 00:03 UTC
Hi!
Firstly thanks for this great module, it works great! I needed it do be able to handle any path, but the printable module was not good enough and so altered it a bit. I am attaching my patch, use it if you like. The only problem is, that there does not seem do be a hook to display something below each page. (hook_links is only executed for nodes). Hence one does need to alter the page.tpl.php in his template.
For example like this:
<div class="links">
<ul class="links inline">
<li class="first print"><a href="/print/path/<?php print $_GET['q']; ?>" title="Display a printer-friendly version of this page." class="print-page print" target="_blank">Printer-friendly version</a></li>
</ul>
</div>
If somebody has a better suggestion, please do let me know.
After you've done this and applied the patch, you should be able to see printer-friendly versions of any path.
Waldemar
| Comment | File | Size | Author |
|---|---|---|---|
| print-all-paths.patch | 4.83 KB | Waldemar |
Comments
Comment #1
Waldemar commentedOh, the template patches, are due to W3C validation errors and incompatibilities with different browsers...
Comment #2
Waldemar commentedComment #3
jcnventuraHello,
Thanks for the patch. Since you are duplicating a lot of code in print_generate_path from other functions in print module (and older versions also!), I will not integrate it directly..
However, I will analyse your changes (and include the template changes) to inspire me.. :)
Comment #4
Waldemar commentedHi,
yes, the code replication is unfortunate and can be easily avoided, if you want me to reuse your other function, I can easily do this. The reason for the replication was that I wanted to keep it well separated from the rest of the module, in case you do not want to integrate it.
Waldemar
Comment #5
jcnventuraHello, Waldemar
I have merged your 'inspiration' in the latest dev release. I made it so that the 'print/path/drupal_path' is not needed. Also, some simplification of the code enabled to remove so much duplication (I passed most of it to a new function).
I have ended up using printable's suggestion of using the hook_help area for non-content pages, and use the 'print' rendering method for content nodes and the 'printable' rendering for non-content pages.
Try it when it becomes available in CVS...
João