function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
paul-lmipaul-lmi 

Overriding doctype and head element (W3C validation)

Is it possible to override the doctype that is generated automatically for pages?  It's currently HTML 4.01 , and we'd like to use XHTML 1.0 STRICT or Transitional (you are not supposed to use self closing tags in HTML 4.01).

 

We'd also like to be able to override/add to the HEAD tag.  There is currently what I consider a bug in the platform where if you use showHeader="false" in the apex:page tag, the title attribute of the apex:page tag is basically ignored.  We'd like to add the title back in without causing any other site validation issues.

 

I've also noticed an inconsistency with the syntax used for the generated HTML tags.

 

If you use apex:styleSheet , the items are generated with self closing tags, whereas the Salesforce included Ajax script and apex:includeScript use a full closing tag.

 

 

<html> <head> [no title, but I used the title attribute in apex:page] <script src="/faces/a4j/g/3_3_0.GAorg.ajax4jsf.javascript.AjaxScript" type="text/javascript"></script> <script src="/support/resource/1248295072000/SelfService/jquery-1.3.2.min.js" type="text/javascript"></script> <link class="user" href="/support/resource/1248295072000/SelfService/survey.css" rel="stylesheet" type="text/css" /> </head>

 

 Also, what Visualforce tag(s) should we be using to ensure the document is wrapped in a <body> tag?  Or is that something we are expected to insert ourselves?

 

Thanks!

 

danielbaladanielbala
I would like an answer to this question as well. this is currently a show stopper for me! I need to use a different doctype, or allow us to override the head. How can we use sites without being able to control basic markup? thank you
danielbaladanielbala

I got an answer some where else:

 

1) Doctype: try the options in this thread: http://community.salesforce.com/sforce/board/message?board.id=Visualforce&message.id=3534