Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

How to include a <style media="print"....> CSS file?

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


dusty at qwer

May 25, 2009, 6:48 AM

Post #1 of 3 (595 views)
Permalink
How to include a <style media="print"....> CSS file?

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
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9 4902 64B4 D16B 2998 93C7
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


faassen at startifact

May 25, 2009, 8:54 AM

Post #2 of 3 (559 views)
Permalink
Re: How to include a <style media="print"....> CSS file? [In reply to]

Hey,

Hermann Himmelbauer wrote:
[snip]
> 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

hurry.resource (an improved take on zc.resourcelibrary's idea) can't do
this right now either, but I suspect it's more hackable than
zc.resourcelibrary. Let me know if you want to hack on it.

Regards,

Martijn

_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


ct at gocept

May 25, 2009, 11:26 PM

Post #3 of 3 (545 views)
Permalink
Re: How to include a <style media="print"....> CSS file? [In reply to]

On Mon, 2009-05-25 at 15:48 +0200, Hermann Himmelbauer wrote:
> Hi,
>
> [...]
>
> 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?

4)

Just have it included as is and add the following section:

@media print {
@import url (print.css);
}

--
Christian Theune · ct [at] gocept
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development
Attachments: signature.asc (0.19 KB)

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.