I'm using a self-created theme with a table-based layout with the navigation on the left side as you can see it on the web on thousands of other pages.
Cause these pages are really ugly to print I was looking for a solution to tell phpWiki not to use the configured theme but to use a printer-friendly theme. I haven't found anything, may be I haven't been looking long and closely enough.
Thus I changed lib/main.php to included another theme if $_REQUEST['theme'] has been passed to the page. In theme/foobar/templates/actionbar.tmpl I added a new Button that add ?theme=print to the URL. lib/main.php will then include themes/print/themeinfo.php and I've all that I wanted.
Question: Is there an 'official' way to get a printer friendly layout without using the upper solution?
If not, may be someone can use the upper description as a hint for own experiments. ;-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The last argument is the media type. If you have one theme for screen, and another for print, then print or print-preview will use the printer-friendly CSS instead of your theme's CSS. As is, the above will use the printer.css from the default theme, but if you want to create your own printer-friendly layout and reference that, you can do that too.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm using a self-created theme with a table-based layout with the navigation on the left side as you can see it on the web on thousands of other pages.
Cause these pages are really ugly to print I was looking for a solution to tell phpWiki not to use the configured theme but to use a printer-friendly theme. I haven't found anything, may be I haven't been looking long and closely enough.
Thus I changed lib/main.php to included another theme if $_REQUEST['theme'] has been passed to the page. In theme/foobar/templates/actionbar.tmpl I added a new Button that add ?theme=print to the URL. lib/main.php will then include themes/print/themeinfo.php and I've all that I wanted.
Question: Is there an 'official' way to get a printer friendly layout without using the upper solution?
If not, may be someone can use the upper description as a hint for own experiments. ;-)
Have you tried putting the following in your themeinfo.php?
$Theme->setDefaultCSS('MyThemeName', 'MyThemeName.css', 'screen');
$Theme->addAlternateCSS(_("Printer"), 'printer.css', 'print');
The last argument is the media type. If you have one theme for screen, and another for print, then print or print-preview will use the printer-friendly CSS instead of your theme's CSS. As is, the above will use the printer.css from the default theme, but if you want to create your own printer-friendly layout and reference that, you can do that too.
Yes, this is used inside the default theme that I used for my own one. I haven't changed this part.
Unfortunately Mozilla and IE seem to ignore the alternative style sheet...