How do I add an HTML header to a Communities visual force page?

Here is the basic page. Need to add a HTML header

<apex:page language="en_US" standardStylesheets="false" showHeader="false" cache="true">
   <body>
         <chatteranswers:allfeeds communityId="XYZ"/>
   </body>
</apex:page>

Answer

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_page.htm

From summer 13 salesforce(28.0) gives us ability to control the tag insertion manually.

In apex page there is an attribute called applyHtmlTag .By default this is true and if set to false then tag wont be generated automatically and instead we can manually add the tag in .

For you case as you have not mentioned anything this is set to true by default .

There is also an attribute applyBodyTag and what this does is control generation of tag into generated markup .

In your case since you have not specified by default it sets as per “applyHtmlTag” so its true so you need not put body tag again

<apex:page language="en_US" standardStylesheets="false" showHeader="false"   cache="true">
     <div>
      <h1>here you can add more html</h1>
     </div>
     <chatteranswers:allfeeds communityId="XYZ"/>
     <div>
      <h3>here you can add more html</h3>
     </div>
 </apex:page>

Attribution
Source : Link , Question Author : user3907 , Answer Author : Mohith Shrivastava

Leave a Comment