Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

salesforce - Zipped css in static resource are not rendered, why?

I zipped the CSS and image file so that the images are accessible by the CSS.

http://www.salesforce.com/us/developer/docs/pages/Content/pages_resources.htm

I've followed documentation code but it is not rendered at all.

    <apex:stylesheet value="{!URLFOR($Resource.jquery_dialog_css_img,
 'jquery_ui_one_dot_eight_dot_eleven.css')}" />

zipped file structure is:

[jquery_dialog_css_img] ---- jquery_ui_one_dot_eight_dot_eleven.css
                         |
                         |---images ----- someImage.jpg

When the visualforce page is rendered the import tag looks like:

        <link class="user" href="/resource/1301916406000/
          manenabi__jquery_dialog_css_img/
          jquery_ui_one_dot_eight_dot_eleven.css" 
          rel="stylesheet" 
          type="text/css" /> 

It looks correct and I have no idea why it is not working. When I click on the generated link:

/resource/1301916406000/ manenabi__jquery_dialog_css_img/ jquery_ui_one_dot_eight_dot_eleven.css

The page is all blank which (I think) means somehow the path is not correct. (If is is correct, the popped up page would show the code like js or css)

like image 522
Meow Avatar asked Jan 21 '23 02:01

Meow


1 Answers

Ok... I had to include root directory.. come on doc, u didn't say that :(

I wanna shoot Salesforce with my paintball.

    <apex:stylesheet value="{!URLFOR($Resource.jquery_dialog_css_img,
 'jquery_dialog_css_img/jquery_ui_one_dot_eight_dot_eleven.css')}" />
like image 151
Meow Avatar answered Mar 08 '23 13:03

Meow