richard@bizarsoftware.com.au writes:
Hrm - that's a little heavy for what I want - which is just an analog of HTMLFile but for CSS files. That is, something I can add to my Python product as an attribute. Definitely no management or other sorts of trickiness required. Look at "App.ImageFile". If you are lucky, you can immediately use it to wrap your CSS files. If not, you should extend "OFS.content_types.guess_content_type" such that it recognizes the ".css" extension.
Dieter
Dieter Maurer wrote:
richard@bizarsoftware.com.au writes:
Hrm - that's a little heavy for what I want - which is just an analog of HTMLFile but for CSS files. That is, something I can add to my Python product as an attribute. Definitely no management or other sorts of trickiness required. Look at "App.ImageFile". If you are lucky, you can immediately use it to wrap your CSS files. If not, you should extend "OFS.content_types.guess_content_type" such that it recognizes the ".css" extension.
That (or rather Image.File) was where I started. I decided to go with HTMLFile as a basis so we could have some DTML in the CSS file - but overrode it so we weren't forced to have the .dtml extension (much happier web designers that way :) Richard -- Richard Jones richard@bizarsoftware.com.au Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)
richard@bizarsoftware.com.au writes:
That (or rather Image.File) was where I started. I decided to go with HTMLFile as a basis so we could have some DTML in the CSS file - but overrode it so we weren't forced to have the .dtml extension (much happier web designers that way :) Thus, the only thing, you need to do in addition, is to set the correct content type.
Dieter
Dieter Maurer wrote:
richard@bizarsoftware.com.au writes:
That (or rather Image.File) was where I started. I decided to go with HTMLFile as a basis so we could have some DTML in the CSS file - but overrode it so we weren't forced to have the .dtml extension (much happier web designers that way :)
Thus, the only thing, you need to do in addition, is to set the correct content type.
Which is pretty much what I did. I've attached the CSSFile class (which I suppose I should have done in the first place)... I'm not sure if this implementation is entirely "correct" - I have no idea what the func_code stuff is for (though if it's not commented out, the class breaks) or the __need_name__... but it works well for us :) Richard -- Richard Jones richard@bizarsoftware.com.au Senior Software Developer, Bizar Software (www.bizarsoftware.com.au)
participants (2)
-
Dieter Maurer -
richard@bizarsoftware.com.au