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 15 2025 08:50:52
Script start
Timing: Jan 15 2025 08:50:52
Module start 'content'
Timing: Jan 15 2025 08:50:52
Module end 'content'
Timing: Jan 15 2025 08:50:52
Script end

Main resources:

Total runtime0.1855 sec
Peak memory usage6,144.0000 KB
Database Queries134

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0081 683.9844214.8047
Module start 'content' 0.00810.0073 898.7891185.3828
Module end 'content' 0.01540.1701 1,084.17191,477.7031
Script end 0.1855  2,561.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00743.9898200.0004
Check MTime0.00170.9173200.0001
Mysql Total
Database connection0.00090.502310.0009
Mysqli_queries0.126568.19751340.0009
Looping result0.00130.69131310.0000
Template Total0.169691.410.1696
Template load0.00271.439610.0027
Template processing0.166989.958310.1669
Override
Cache load0.00241.287110.0024
Sytem overhead
Fetch class attribute can translate value0.00110.609610.0011
XML
Image XML parsing0.00030.188110.0003
General
dbfile0.00130.7221140.0001
String conversion0.00000.002730.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.0001 secs