+ Start a Discussion
Mandy08Mandy08 

Is Static Resource the way to go????

Hello -

Trying to create a very simple public website for my customer, I don't want them to have access

to any Salesforce content as of yet, this will simply be a temporary webpage with some

business content. Anyway - I read in the Help & Training area that creating a "Static Resource"

to house my CSS & Html code, maybe logo images and such was better then creating links

back to the documents tab. Can anyone tell me if this is true?  If I can upload a zip file with all

my pertinent codes, images, etc....and then simply reference that zip file in my apex visual force page?

I want my website to look just like a normal website, no salesforce formatting/feel.

If this is possible what is the code/reference I would use on my visualforce page.

 

Thanks in advance

Amanda

Best Answer chosen by Admin (Salesforce Developers) 
RyanGuestRyanGuest

There isn't really a way to turn off the errors.

 

I would suggest just adding your HTML in small bits, almost line by line.

All Answers

RyanGuestRyanGuest

I would put your images and CSS in Salesforce static resources.

 

I wouldn't put the HTML in static resources, instead drop it directly into your Visualforce page.

Mandy08Mandy08

Thanks again Ryan....:)

Do you know the apex coding to call out the static resource, and do I keep the file as a zip?

 

Amanda

RyanGuestRyanGuest

Lets say you upload MyFile.zip as a static resource. Inside the directory img you have a file named background.gif. Here is what you would do:

 

 

 

"{!URLFOR($Resource.MyFile, 'img/background.gif')}"

 

 

so an image tag would look like this:

 

 

<img src="{!URLFOR($Resource.MyFile, 'img/background.gif')}" />

 

 

BulentBulent

here is the related article

Mandy08Mandy08

Ryan -

Still struggling with this, I keep getting those error message to add end tags and when I do

they still show up, as if it doesn't see I added the endtag to the required line. Is there anyway

to turn off these error messages so I can see what the end result is??

This is making me crazy.

 

Thanks

Amanda

RyanGuestRyanGuest

There isn't really a way to turn off the errors.

 

I would suggest just adding your HTML in small bits, almost line by line.

This was selected as the best answer