1

I created a VF page which uses static resources styles. The cache control property is set to public. Every thing is displaying for me.

But styles are not getting applied for external users, as url is changing when they access that page from community.

So my question is how to add static resources in VF page so that they can be accessed even the url changes. Is it possible ?

Here is my code:

<link rel="stylesheet" href="/resource/cssDesigns/CssStyles/style.css"/>   
<link rel="stylesheet" href="/resource/cssDesigns/CssStyles/home.css"/>
0

1 Answer 1

2

I have some pages that are used through a Site (and so have an extra name added to the URLs as communities do) and this syntax:

<link href="{!URLFor($Resource.cssDesigns, 'CssStyles/style.css')}" rel="stylesheet" />

works automatically i.e. the generated URL in the HTML page has the correct extra name part. So I suggest you use this syntax: it also gives you compile time checking (at least of the resource name).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .