20081228 Sunday December 28, 2008

Optimising a Roller theme for printing

Inspired by Phil Harman's Trials with his roller theme I have wanted to create a better hard copy experience for you. I implemented this earlier this morning on my blog's roller files. It has been tested using Opera's print preview on the main weblog page and the comments view of an article and so should work on a view based on a tag, category, or date.

I have implemented a 2nd CSS file. Because my theme's base is so old, it is not conformant to the stylesheet/theme file structures of today's roller so I implemented it as just any old template file. The form lets you know/set the URL. It contains the following rules.

.noPrint
    { display: none; }
.noshow
    { visibility: hidden;}

It is introduced to the weblog using the following code in the weblog template file, in the HEAD section. The assignment in a LINK or STYLE tag with the MEDIA="print" attribute is what applies this rule only when printing.

<LINK HREF="http://blogs.sun.com/DaveLevy/page/print.css"
    TYPE="text/css" REL="stylesheet" MEDIA="print">

I used the 'new file' form to set the url of the new file as above, but named it _printcss; it needs a preceding _ to become invisible to some of the roller macros such as #showBasicNavBar, and the form won't permit a .css suffix. It might be cleverer to call the file _cssprint, so that the css files are all adjacent to each other in an alphabetic sort, which you get on the 'edit templates' form.

I have applied the 'noPrint' rule to the Banner, the webCategoryChooser and Sidebar. I have not used the 'noShow' rule, which I developed to apply to objects that occupy vertical space in a table. The rules are applied to a DIV for the banner, P for the web catgory chooser and TABLE for the sidebar. Another pointer to the fact I must find time to remove the tables from this theme. I am working on it I promise.

tags:

              

(2008-12-28 10:02:54.0) Permalink Comments [2]

Notice: New media=print rules

All weblog views on this blog can now be printed, the banner and sidebar will not be shown in the printed version. This has been tested using Opera's print preview, and should work for the weblog, tag, category, date and comment views. It has not been set for the "About Me" page, nor "Yesterday's Words".

tags: none

              

(2008-12-28 09:35:26.0) Permalink

Innovate on OpenSolaris
   in London

  Subscribe to this blog XML

  Now referenced at is.gd,
    http://is.gd/1BW3h

  AddThis Feed Button

  

  See my delicious tag cloud, or
  follow it using a feed reader.

  Also my sun mediacaster page

  Link to my FOAF file

News
Recent & Interesting
All about my site
Recently at del.icio.us
links
Article Index
archives

  2009

  2008

  2007

  2006

  2005

  2004

Blogosphere

Locations of visitors to this page >
referers