ez.no: Printing CSS

Author Message

Alex Jones

Monday 26 January 2004 8:25:32 am

It would be helpful to have a style sheet set up for printing that removes some of the elements that are not needed on paper such as the top navigation and the sidebar in documentation. I have created a basic print style sheet that formats the pages of documentation so they are a bit more printer-friendly. I have done some basic tests on pages in the documentation sections in IE 6, Firebird .7 and Mozilla 1.6 on XP -- the styles appear to print out properly. I am pasting the code below in case the folks at eZ systems would like to build off of it, or if anyone else wants to see how to do it. Should I have more time to expand it, I will post the results.

If you are using Mozilla you can use the Edit CSS bookmarklet, or should you be running Firebird, you can use the Edit CSS sidebar, either of which allows you to edit the CSS of a page you are viewing. Paste the CSS at the bottom of the displayed styles to see what it looks like, and print out the page.

Edit CSS Bookmarklet (Moz): http://www.squarefree.com/bookmarklets/webdevel.html#edit_styles
Edit CSS Sidebar (Firebird only): http://editcss.mozdev.org/

[Print CSS]

body {
  background-image: none !important;
  }

#toparea ul, #topmenu, #submenu, #searchbox, #path, #sidebar, #maincontent .block {
  display: none;
  }
  
#maincontent {
  border: 0px;
  margin: 0em;
  margin-left: -45px;
  padding: 0px;
  width: 99%;
  }
 
#contentarea {
  background-image: none !important;
  border: 1px solid red;
  margin: 0em;
  padding: 0px;
  width: auto;
  }

#contentareaspacing {
  margin: 0px;
  }

#documentationblock pre {
  font-size: 26px;
  }

pre {
  font-size: 1em !important;
  }

#footer ADDRESS {
  width: 88%;
  }

Again, please note, I did this in a short period of time, so it really should be tested.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 00:16:37
Script start
Timing: Jan 31 2025 00:16:37
Module start 'layout'
Timing: Jan 31 2025 00:16:37
Module start 'content'
Timing: Jan 31 2025 00:16:38
Module end 'content'
Timing: Jan 31 2025 00:16:38
Script end

Main resources:

Total runtime0.7608 sec
Peak memory usage8,192.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0038 588.0313151.1953
Module start 'layout' 0.00380.0027 739.2266220.6563
Module start 'content' 0.00650.7536 959.88284,377.0703
Module end 'content' 0.76010.0006 5,336.95318.0313
Script end 0.7607  5,344.9844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.3961160.0002
Check MTime0.00110.1499160.0001
Mysql Total
Database connection0.00050.071110.0005
Mysqli_queries0.693691.1736460.0151
Looping result0.00030.0412440.0000
Template Total0.718594.420.3592
Template load0.00200.263420.0010
Template processing0.716594.174620.3582
Template load and register function0.00110.142910.0011
states
state_id_array0.00170.222510.0017
state_identifier_array0.00080.110920.0004
Override
Cache load0.00170.2184120.0001
Sytem overhead
Fetch class attribute can translate value0.00120.156910.0012
Fetch class attribute name0.00140.185020.0007
XML
Image XML parsing0.00160.205610.0016
class_abstraction
Instantiating content class attribute0.00000.000520.0000
General
dbfile0.00170.2210160.0001
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 9
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs