Trouble with custom css (browser resource)

4 messages Options
Embed this post
Permalink
rcecil () Trouble with custom css (browser resource)
Reply Threaded More More options
Print post
Permalink
Hello,

I'm developing a custom AT type and I have created a new browser view (directoryentry.pt) that utilizes a css registered through a configure.zcml <browser:resource> stanza:

<configure ...>

  <browser:resource
        name="twinpeaks-directoryentry.css"
        file="directoryentry.css"
        />
       
  <browser:resource
        name="frame.png"
        image="frame.png"
        />

...

My utilization of the css is in directory.pt, right after the <body> tag:

<metal:css fill-slot="css_slot">
    <style type="text/css" media="all"
            tal:content="string: @import url(${context/++resource++twinpeaks-directoryentry.css});"></style>          
</metal:css>

When I view the browser view when the instance is running, and view source, I can see that the TAL expression has worked at it looks like:

...
<style type="text/css" media="all"> @import url(http://localhost:8080/site/directory/cecil/++resource++twinpeaks-directoryentry.css);</style>
...

The only problem is that the css in that file is not applied. It contains a single css stanza developed and tested to work using external static html.

I can successfully bring up a browser image resource, by typing this directly into my browser ('cecil' is the title of an instance of my custom AT type):

http://localhost:8080/site/directory/cecil/++resource++group.png

I can see the graphic that verifies the browser resource registration succeeded for "group.png".

However when I try the same technique on the actual css:

http://localhost:8080/site/directory/cecil/++resource++twinpeaks-directoryentry.css

I get a blank browser window, presumably because a zero-byte css file is returned.

I get the same results when I turn portal_css debug mode on.

Any ideas?

Thanks in advance!

Rob Cecil
rcecil () Re: Trouble with custom css (browser resource)
Reply Threaded More More options
Print post
Permalink
Fwiw,

I am not using any caching technology (other than the browser), and running the browser directly against the non-ZEO, regular Zope server.

Thanks

rcecil wrote:
Hello,

I'm developing a custom AT type and I have created a new browser view (directoryentry.pt) that utilizes a css registered through a configure.zcml <browser:resource> stanza:

<configure ...>

  <browser:resource
        name="twinpeaks-directoryentry.css"
        file="directoryentry.css"
        />
       
  <browser:resource
        name="frame.png"
        image="frame.png"
        />

...

My utilization of the css is in directory.pt, right after the <body> tag:

<metal:css fill-slot="css_slot">
    <style type="text/css" media="all"
            tal:content="string: @import url(${context/++resource++twinpeaks-directoryentry.css});"></style>          
</metal:css>

When I view the browser view when the instance is running, and view source, I can see that the TAL expression has worked at it looks like:

...
<style type="text/css" media="all"> @import url(http://localhost:8080/site/directory/cecil/++resource++twinpeaks-directoryentry.css);</style>
...

The only problem is that the css in that file is not applied. It contains a single css stanza developed and tested to work using external static html.

I can successfully bring up a browser image resource, by typing this directly into my browser ('cecil' is the title of an instance of my custom AT type):

http://localhost:8080/site/directory/cecil/++resource++group.png

I can see the graphic that verifies the browser resource registration succeeded for "group.png".

However when I try the same technique on the actual css:

http://localhost:8080/site/directory/cecil/++resource++twinpeaks-directoryentry.css

I get a blank browser window, presumably because a zero-byte css file is returned.

I get the same results when I turn portal_css debug mode on.

Any ideas?

Thanks in advance!

Rob Cecil
rcecil () Re: Trouble with custom css (browser resource)
Reply Threaded More More options
Print post
Permalink
In reply to this post by rcecil
Other info:

    *  Plone 3.2.1
    * CMF 2.1.2
    * Zope (Zope 2.10.6-final, python 2.4.6, darwin)
    * Python 2.4.6 (#1, Apr 26 2009, 10:35:06) [GCC 4.0.1 (Apple Inc. build 5465)]
    * PIL 1.1.6

Running Mac OS X.

I build my plone instances by hand using paster and buildout only.

Thanks

rcecil wrote:
Hello,

I'm developing a custom AT type and I have created a new browser view (directoryentry.pt) that utilizes a css registered through a configure.zcml <browser:resource> stanza:

<configure ...>

  <browser:resource
        name="twinpeaks-directoryentry.css"
        file="directoryentry.css"
        />
       
  <browser:resource
        name="frame.png"
        image="frame.png"
        />

...

My utilization of the css is in directory.pt, right after the <body> tag:

<metal:css fill-slot="css_slot">
    <style type="text/css" media="all"
            tal:content="string: @import url(${context/++resource++twinpeaks-directoryentry.css});"></style>          
</metal:css>

When I view the browser view when the instance is running, and view source, I can see that the TAL expression has worked at it looks like:

...
<style type="text/css" media="all"> @import url(http://localhost:8080/site/directory/cecil/++resource++twinpeaks-directoryentry.css);</style>
...

The only problem is that the css in that file is not applied. It contains a single css stanza developed and tested to work using external static html.

I can successfully bring up a browser image resource, by typing this directly into my browser ('cecil' is the title of an instance of my custom AT type):

http://localhost:8080/site/directory/cecil/++resource++group.png

I can see the graphic that verifies the browser resource registration succeeded for "group.png".

However when I try the same technique on the actual css:

http://localhost:8080/site/directory/cecil/++resource++twinpeaks-directoryentry.css

I get a blank browser window, presumably because a zero-byte css file is returned.

I get the same results when I turn portal_css debug mode on.

Any ideas?

Thanks in advance!

Rob Cecil
rcecil () Re: Trouble with custom css (browser resource)
Reply Threaded More More options
Print post
Permalink
In reply to this post by rcecil
Solved that problem. Turns out my i18n:domain attribute was set incorrectly in the page template.

rcecil wrote:
Hello,

I'm developing a custom AT type and I have created a new browser view (directoryentry.pt) that utilizes a css registered through a configure.zcml <browser:resource> stanza:

<configure ...>

  <browser:resource
        name="twinpeaks-directoryentry.css"
        file="directoryentry.css"
        />
       
  <browser:resource
        name="frame.png"
        image="frame.png"
        />

...

My utilization of the css is in directory.pt, right after the <body> tag:

<metal:css fill-slot="css_slot">
    <style type="text/css" media="all"
            tal:content="string: @import url(${context/++resource++twinpeaks-directoryentry.css});"></style>          
</metal:css>

When I view the browser view when the instance is running, and view source, I can see that the TAL expression has worked at it looks like:

...
<style type="text/css" media="all"> @import url(http://localhost:8080/site/directory/cecil/++resource++twinpeaks-directoryentry.css);</style>
...

The only problem is that the css in that file is not applied. It contains a single css stanza developed and tested to work using external static html.

I can successfully bring up a browser image resource, by typing this directly into my browser ('cecil' is the title of an instance of my custom AT type):

http://localhost:8080/site/directory/cecil/++resource++group.png

I can see the graphic that verifies the browser resource registration succeeded for "group.png".

However when I try the same technique on the actual css:

http://localhost:8080/site/directory/cecil/++resource++twinpeaks-directoryentry.css

I get a blank browser window, presumably because a zero-byte css file is returned.

I get the same results when I turn portal_css debug mode on.

Any ideas?

Thanks in advance!

Rob Cecil