Menu

Printer friendly layout solution, good idea?

Seep
2002-09-24
2012-10-11
  • Seep

    Seep - 2002-09-24

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

     
    • Cuthbert Cat

      Cuthbert Cat - 2002-09-28

      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.

       
    • Seep

      Seep - 2002-10-07

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

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.