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
sandy1234sandy1234 

VF page problem

I have couple of pages in an application
Says as page1 ,page2,page3,page4,page5.All the five pages are having same content as footer and header??
when i add some sentences on page 1 ,it should appear in all the pages .How can we achieve this??
manhnt.bkitmanhnt.bkit
I suggest you look at the Visualforce workbook, it has an example,
at Tutorial #9: Reusing Pages with Templates.
reused templete with tag <apex:composition template="BasicTemplate">
Arunkumar.RArunkumar.R

Hi Sandy,

You can achieve this problem by using <apex:composition> tag.

 

Pupose of Composition tag:

 

1. An area of a page that includes content from a second template page.

 

2. Template pages are Visualforce pages that include one or more < apex:insert > components.

 

3. The < apex:composition > component names the associated template, and provides body for the template's < apex:insert > components with matching < apex:define > components.

 

4. Any content outside of an < apex:composition > component is not rendered.

 

 

For more and clear info with example please refer the below links,

 

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

 

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

 

 

http://www.infallibletechie.com/2013/04/apexinsert-apexcomposition-apexdefine.html

 

Hope this may helps you...!


If you found this answer helpful to you... Please accept this as a Solution and  give kudos by clicking on the star icon.

 

Thanks and Regards,

Arunkumar.R | Salesforce Certified Developer