You need to sign in to do that
Don't have an account?
Accessing static resources in Lightning components
Hi,
How do I access a ZIP static resource dynamically in a Lightning componenet? I tried the {!URLFOR()} notation but it is not supported. I want to import a style sheet.
Thanks
How do I access a ZIP static resource dynamically in a Lightning componenet? I tried the {!URLFOR()} notation but it is not supported. I want to import a style sheet.
Thanks
simply call like this: --
May the Force.com be with you!
neither /resource/ZIPPED_RESOURCE_NAME
nor/resource/package__ZIPPED_RESOURCE_NAME
nor /resource/package/ZIPPED_RESOURCE_NAME
worked for me so far. Any workarounds?
<apex:stylesheet value="{!URLFOR($Resource.SLDS0120, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/apps_css_external_platform.htm
So i kind of used a cheat way. I uses the prebuilt zip file provided by salesforce in my components obtained from below link. This zip file has folder called /asset/images . Place you .png or .jpg files inside this folder (eg: pic1.png). Similary if you have additional own style sheets and fonts, place in /assets/fonts and /assets/styles.
Now save the new zip and attach this zip as static resource. Now use the images like below and it was workign for me. I essentialy used the prebuilt salesforce lightning zip package and tweaked it a bit, without need of compiling. This worked for me and let me know if there is a better way
Please use below link....
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/expr_resource_value_provider.htm
Regards,
Suresh.