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

CommentFileSizeAuthor
print-all-paths.patch4.83 KBWaldemar

Comments

Waldemar’s picture

Oh, the template patches, are due to W3C validation errors and incompatibilities with different browsers...

Waldemar’s picture

Status: Active » Needs review
jcnventura’s picture

Hello,

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.. :)

Waldemar’s picture

Hi,

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

jcnventura’s picture

Status: Needs review » Closed (fixed)

Hello, 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