[Product-Developers] Register an CSS-File??

Alex Clark aclark at aclark.net
Thu Aug 11 13:12:03 UTC 2011


Hi,

On 8/11/11 8:48 AM, vii wrote:
> Hello List
>
> Sorry for bordering you again but I've been reading and trying and testing
> for about 8 hours now and it seems that I'm to stupid to finish this rather
> simple task (I beliefe).

You are not too stupid, but if something is taking too long your 
approach may be wrong.

>
> I have a content type and want to give it its own css-File. I created the
> css-File in the browser-folder "browser/mycontenttype_styles.css" and an
> xml-file  "profiles/default/cssregistry.xml" with this content:
>
> <?xml version="1.0"?>
>
>    <stylesheet
>      id="mycontenttye_styles.css" title=""
>      media="all" rel="stylesheet" rendering="import"
>      cacheable="True" compression="safe" cookable="True"
>      enabled="1" expression="" />
>
>
> But after I de-installed and re-installed the product in my plonesite if I
> check the portal_css I always get the error message "(resource not found or
> not accessible)" next to the line for this css-file.
>
> Can you please tell me whats wrong?


I don't understand:

* How is this stylesheet (assuming you are able to get it registered 
correctly) going to apply to *only* your content type?

Generally we don't apply style sheets to a particular content type, or 
at least I'm not familiar with this approach. Another approach I'm sure 
would work:

* In the "default view template" of your content type, inline the styles 
there. And/or use some custom CSS classes/ids that you can style from 
any stylesheet e.g. ploneCustom.css


Alex




>
> regards
> viktor
>
> --
> View this message in context: http://plone.293351.n2.nabble.com/Register-an-CSS-File-tp6676252p6676252.html
> Sent from the Product Developers mailing list archive at Nabble.com.


-- 
Alex Clark · http://aclark.net



More information about the Product-Developers mailing list