Salesforce - Zipped css in static resource not showing, why?

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

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

I have executed the documentation code, but it is not displayed at all.

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

Pinned File Structure:

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

When rendering a visualforce page, the import tag is as follows:

  <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 right, and I have no idea why it is not working. When I click on the generated link:

/ resources / 1301916406000 / manenabi__jquery_dialog_css_img / jquery_ui_one_dot_eight_dot_eleven.css

The page is blank, which (I think) means the path is incorrect. (If true, the popup will show the code as js or css)

+4
source share
2 answers

Ok ... I had to include the root directory. Come to the doc, and did not say that: (

I want to 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')}" /> 
+5
source

In fact, here you need to make sure that your zip file name matches the name of the resource.

So this code:

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

It must match the resource with the name "name", and the file uploaded to the resource must also be exactly "name.zip".

Then inside name.zip you should put the style.css file and image directory

+3
source

Source: https://habr.com/ru/post/1346552/


All Articles