2022.2

Table Of Contents
Thefollowingscriptclonesandpopulatesaboilerplaterow.Oncecompletedyouwillneedtohidethe
boilerplaterow.
html()
InaControlScript,thehtml()functionofasectionorMasterPagecanbeusedtogettheinitialcon-
tentsofits<body>,andmodifythem.Thismakesitpossible,forexample,topopulateasectionor
MasterPagewithelementsretrievedfromaContentManagementsystem,beforeStandardScripts
run.
html()
Getstheinitialcontentsofthe<body>ofasectionorMasterPage.
html(value)
Replacesthecontentsofthe<body>ofasectionorMasterPagewiththesuppliedvalue.Thisfunction
isonlyavailableinControlScripts.Seealso:"section"onpage848and"masterpage"onpage817.
value
AStringthatmaycontainHTMLtags.
Examples
Thefollowingscriptuseshtml()toretrievethecontentsofasectionandaddaparagraphtoit.
var foo = merge.context.sections["Section 1"].html();
foo += "<p>hello world</p>";
merge.context.sections["Section 1"].html( foo );
Thefollowingscriptloadsasnippetbasedonthevalueofafield,andthenreplacesthecontentofa
Printsectionwiththesnippetusinghtml().
var mySection = merge.context.sections["Section 1"];
var promoTxt = loadhtml('snippets/promo-' + record.fields['City'] + '.html');
mySection.html(promoTxt);
paginate()
Thismethodofthesectionobject(see"section"onpage848)triggerspaginationofthecurrentsec-
tion.Thepaginationprocessre-establishespageboundaries,updatespagenumbersandpagecounts,
andreappliesMasterPages.
Dependingonwhetherpagenumberingrestartsineachsectionthismayaffectthepagenumbersin
othersectionsaswell(see"Configuringpagenumbers"onpage137).
Whenthepaginationprocesshasended,thescriptresumes.
Page 833