[Zope-dev] How to include a <style media="print"....> CSS file?

Hermann Himmelbauer dusty at qwer.tk
Mon May 25 09:48:39 EDT 2009


Hi,
I'm currently to make my application printer-friendly, thus I'd like to 
include a print-CSS file. Currently, I include CSS-files like that:

--------------------------------------------------------
  <resourceLibrary name="bspskin-lib"
    layer="zbsp.skin.interfaces.IBSPLayer"
    >
      <directory
        source="lib"
        include="base.css"
      />
  </resourceLibrary>  
--------------------------------------------------------

This creates the following code:

--------------------------------------------------------
    <style type="text/css" media="all">
      <!--
        @import 
url("http://localhost:8088/BSPSite/act/@@/bspskin-lib/base.css");
      -->
    </style>
--------------------------------------------------------

What I'd like to have now is to include some other CSS-file with 
media="print".

The zc.resourcelibrary code seems not to be able to handle this, so I'm 
curious how to do this:

1) Simply write this directly into my page template
2) Hack zc.resourcelibrary, e.g. add a ZCML-directive "media"
3) Use some other package I'm unaware of

Any suggestions?

Best Regards,
Hermann

-- 
hermann at qwer.tk
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7


More information about the Zope-Dev mailing list