Forums / Suggestions / ez.no: Printing CSS

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>

eZ debug

Timing: Jan 30 2025 21:10:07
Script start
Timing: Jan 30 2025 21:10:07
Module start 'content'
Timing: Jan 30 2025 21:10:07
Module end 'content'
Timing: Jan 30 2025 21:10:07
Script end

Main resources:

Total runtime0.2366 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0074 587.8281370.3047
Module start 'content' 0.00740.0126 958.13281,001.6094
Module end 'content' 0.02000.2165 1,959.74223,893.2031
Script end 0.2365  5,852.9453 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00451.8877200.0002
Check MTime0.00130.5641200.0001
Mysql Total
Database connection0.00090.361010.0009
Mysqli_queries0.140859.50161410.0010
Looping result0.00140.59441390.0000
Template Total0.216291.410.2162
Template load0.00080.338610.0008
Template processing0.215491.040410.2154
Override
Cache load0.00060.240110.0006
Sytem overhead
Fetch class attribute can translate value0.00220.911410.0022
XML
Image XML parsing0.00020.092610.0002
General
dbfile0.00863.6251200.0004
String conversion0.00000.011930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs