You need to sign in to do that
Don't have an account?
Mandy08
Can I use already developed html in my visual force page?
Hello -
I'm just getting started trying to create a very basic public website for my customers.
I have EE and know this is possible. After I created my site I need to assign my visual force
home page. Can I simply copy and paste already existing HTML page into a visual force
page without having to use excessive amounts of apex coding?
Any help or comments appreciated.
Amanda
You can pretty much copy and paste HTML code into Visualforce.
A couple of quick gotchas:
- You'll need to put your HTML code inside <apex:page> tags.
Example:
<apex:page showHeader="false" standardStylesheets="false">
<html>
.....
</html>
</apex:page>
- When you save your page, you may see some warning about not enclosing all tags properly. You'll want to fix those.
Example:
will need to become:
- The default cache time is 10 minutes, if you are using basic HTML and don't have anything dynamic, I would suggest increasing this by adding <apex:page showHeader="false" standardStylesheets="false" cache="true" expires="10800"> to your page header. This will cache the page for 3 hours at a time (will make it go A LOT faster)
All Answers
You can pretty much copy and paste HTML code into Visualforce.
A couple of quick gotchas:
- You'll need to put your HTML code inside <apex:page> tags.
Example:
<apex:page showHeader="false" standardStylesheets="false">
<html>
.....
</html>
</apex:page>
- When you save your page, you may see some warning about not enclosing all tags properly. You'll want to fix those.
Example:
will need to become:
- The default cache time is 10 minutes, if you are using basic HTML and don't have anything dynamic, I would suggest increasing this by adding <apex:page showHeader="false" standardStylesheets="false" cache="true" expires="10800"> to your page header. This will cache the page for 3 hours at a time (will make it go A LOT faster)
Thanks so much, I was wondering about those warnings...
I really appreciate it.
Amanda