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
new2forcenew2force 

How to insert HTML templatee into VF pages

Hi everyone,

 

Iam trying to insert html template into VF page. Can u plz tell  me the way to do that

Pradeep_NavatarPradeep_Navatar

Find below a sample code:

 

                -----------  VF Page  -------------

                <apex:page>

                                <apex:OutputText value="{!propTempBody}" />

                </apex:page>

 

                ----------  Controller  -----------

                public string propTempBody{get;set;}

                Folder fd = [Select id, name From Folder Where name = 'MyFolder'];

                EmailTemplate emTemp = [Select id, name, subject, body From EmailTemplate Where FolderId=:fd.id and name='MyEmailTemplate' limit 1];

                propTempBody = emTemp.body;

 

Hope this helps.

new2forcenew2force

Hi Pradeep thanks for ur reply.

 

I wanna include a  html template page which is having an image and a footer but not the Email Template

Cory CowgillCory Cowgill

Visualforce has a concept called Templates & Compositions which allows you to have a Template (Header,Footer,Content) and Compositions (Body Content).

 

Take a look at the <apex:composition> tag in the standard library reference.