+ Start a Discussion
Blair ManyBlair Many 

How can I access HTML pages within a static resource?

I have a web-site with a number (hundreds) of HTML documentation pages.

I am tying to make this help available within sales force.

It seems logical to zip up all of these web pages and post them in a static resource.    Then reference the individual pages from the index page using the URLFOR process.   When using {URLFOR()} the resulting page is blank.   I believe is correctly pointing to the correct resource because if I back out the file name from the URL Sales Force downloads the entire ZIP file to me.     So I believe the syntax I am using is just slightly off.    
<a name="SomeName" href="{!URLFOR($Resource.DOCS,'SomePage.htm')}" target="showframe">SomeDescription</a>
What happens when this link is clicked is that it renders a blank page.

Any Suggestions / Examples would be greatly appreciated.
 
JyothsnaJyothsna (Salesforce Developers) 
Hi,

Please refer the below example.

step1:

The below link is my HTML demo page
http://devender-developer-edition.ap1.force.com/resource/Htmlcontent


User-added image

first, go to that link and save that link.
 
step 2: Go to static resource and enter the details. For your reference please check the below screenshot.

User-added image


Step 3:

The way you have to refer is
 
 
<apex:iframe src="{!URLFOR($Resource.htmlpage)}"/>


htmlpage is the static resource name.


Let me know if you need any help!

Please mark the answer as Best Answer if it really helped so that it would help others as well in future.

Best Regards,
Jyothsna
 
Blair ManyBlair Many
I have tried this page sample that you sent but I do not find that any of the links on the page render for me at all. They all open up to a blank page. http://devender-developer-edition.ap1.force.com/resource/Htmlcontent Which is the exact situation I am having with my own resources. Blair P. Many | Senior Software Developer | Paragon Application Systems 326 Raleigh Street - Holly Springs, NC 27540 USA | Direct: +1.919.741.5216 Email: bmany@paragonedge.com | www.paragonedge.com [cid:F119CBCE-7655-442F-B08E-8EB8A39BF905]
JyothsnaJyothsna (Salesforce Developers) 
Hi,

Once you click the link, it opens the below output.

User-added image
 
save as the above page (ex: page name is htmlcontent)
 
Now go to static resources:
 
Name: htmlpage
Choose file: select you recently saved file name is htmlcontent.
 
 cache control  : public
 
click, save.
 
go to your visual force page  and add the below line
 
<apex:iframe src="{!URLFOR($Resource.htmlpage)}"/>

Here htmlpage is static resource name.

The final out of the visual force page is 


User-added image
 
 
 



Let me know if you need any help.

Best Regards,
Jyothsna
Blair ManyBlair Many
So are you saying that the links on your page such as About Us Privacy Statement Terms of Use Read Our Reviews Should all of those links open up when I click them? Because I have tried several different PCs and a MAC and when I click those links they open a blank white page with no source code. Blair P. Many | Senior Software Developer | Paragon Application Systems 326 Raleigh Street - Holly Springs, NC 27540 USA | Direct: +1.919.741.5216 Email: bmany@paragonedge.com | www.paragonedge.com [cid:6F6FA416-AA50-4B6C-8C75-0DCAE308B998]
JyothsnaJyothsna (Salesforce Developers) 
If you want source code for the above link. First, go to the link and right-click the mouse and select the source code. 

The above example is the sample one. When you click About Us or other links, it opens a blank page. Because I didn't write any functionality for the above links.