I've searched high and low for an easy way (non module based) to add a banner or some static text to my "Printer-friendly version" export pages.

Basically I just want to add a banner across the top of the page so when it's printed, there's a clue as to the name of the website. I made a banner, but am not sure how to get it to show up.

I was hoping I could find a lead on modifying the page.tpl.php to create a new page specifically called for the Printer-friendly version, but could not. Can I do this? What do I call the page? I tried print.page.tpl.php and print-page.tpl.php, but neither worked.

Also, for some reason when I view source on the exported pages I see in the source that misc/print.css is the style sheet vs. the print.css style sheet in the theme folder. This baffles me as I thought the style sheet would be from the theme folder.

Thanks in advance!

Comments

Bairnsfather’s picture

So I rooted around somewhat and found these two files of interest in /modules/book: book-export-html.tpl.php and book-node-export-html.tpl.php.

I added my quick hack of an <img> tag in the former file and I achieved my goal.

But when I copied/moved book-export-html.tpl.php to the theme folder or to /sites/[site]/modules/book, it was not picked up. So I have a very clunky hack.

Do I have to override a function somehow? Which I've not done before.

I have a multisite install and the banner is specific to one site.

If someone gives me some guidance I'll write up some documentation for the Drupal handbook.

chalu’s picture

I think you also need to have a (the default) copy of book.tpl.php in the folder that contains your over-written (book-export-html.tpl.php) template file. Give it a try and let me know.

Cheers