2022.2

Table Of Contents
Web pages
Webpages(alsocalledWebsections)arepartoftheWebcontext(see"WebContext"onpage496)in
atemplate.
TheWebcontextoutputsoneHTMLwebpage.InadditiontotheHTMLtextitcontainseitherthe
resourcesorreferencestotheresourcesnecessarytodisplayit.
JavaScriptfilesareaddedtothe<head>inthegeneratedHTMLfile.JavaScripttoolboxeslikejQuery
anditsplugins,orMooTools,areusefulwhenyouwanttoimplementspecialfeaturesinthewebpage.
(See"UsingJavaScript"onpage512)
Stylesheetsarealsoaddedtothe<head>andareusedjustastheywouldbeusedinaregularweb
page.(Alsosee:"StylingtemplateswithCSSfiles"onpage672)
AWebcontextcancontainmultipletemplates.WhengeneratingoutputfromtheWebcontext,how-
ever,onlyoneoftheWebtemplatescanbemergedwitheachrecord.Setthe'default'Websection
(see"SettingadefaultWebpageforoutput"onpage501)beforegeneratingWeboutput;alsosee
"GeneratingWeboutput"onpage1348.
CreatingaWebpage
WhencreatingaWebpage,itisadvisabletofollowdesignguidelinesforwebpages,sothattheyare
likelytolookgoodindifferentbrowsersandondifferentdevicesandscreensizes.Whenyoustartwith
aWebTemplateWizard,theFoundationframeworkisaddedtothetemplate,toguaranteejustthat;
see"CreatingaWebtemplatewithaWizard"onpage493.Otherapproachesaredescribedbelow,in
"AddingaWebpage"below.
AddingaWebpage
WhenaWebtemplateiscreated(see"CreatingaWebtemplatewithaWizard"onpage493),onlyone
Websectionisaddedtoit.AWebcontextmaycontainvarioustemplates,butperrecordonlyoneof
thosecanbeusedtogenerateoutput.
ItisnotpossibletoaddaWebsectiontoanexistingWebcontextwiththehelpofaTemplateWizard.
Toprovidealternativecontentforthewebpage,youcoulduseConditionalContent(see"Showingcon-
tentconditionally"onpage734),orSnippetsandascript(seetheHelptopics"Snippets"onpage661
and"Loadingasnippetviaascript"onpage831,andthishow-to:Multi-pageWebtemplate.)
Tip: Foranexampleofhowtoservedifferentwebpagesusingsnippets,seethefollowinghow-
to:Creatingamulti-pageWebtemplate.
Ifyouwouldliketostartwithatemplatethatisidenticaltotheoneyoualreadyhave,considercopyingit
(see"Copyingasection"onpage433).
ToaddablanksectiontotheWebcontext:
Page 498