2022.2

Table Of Contents
Stylingisdoneviastyle sheets(see"Localformattingversusstylesheets"onpage671).Thestyle
rulesareinthecontext_print_styles.cssfile.NotehowtheycombinetheHTMLtag,IDandclassofele-
mentstoselectthem.(Seealso:"SelectorsinOLConnect"onpage825.)
Scripts
Scriptspersonalizecontent.MostofthesciptsintheInformationfolder(ontheScriptspane)aremade
withtheText Script Wizard(see"UsingtheTextScriptWizard"onpage729).
Tip: HoveroverthenameofascriptintheScriptspanetohighlightpartsofthetemplatethatare
affectedbythescript.
Textthatshouldbereplacedbydataisnotonlysurroundedby@(e.g.@date@)butalsowrappedina
span(see"Span"onpage625).EachspanhasanID,oraclassifthesametextoccursmorethan
once,tousethatastheselectorofthescript.TheselectoroftheInvoiceTotalscript,forinstance,isa
class:.inv-total.
Wrappingelementsinabox(see"Boxes"onpage623)orinasemanticHTMLelementmakesiteasier
totargettheminascriptorinastylesheet.Placethecursorintheelementorselectmultipleelements.
Then,onthemenu,clickInsert > Wrap in Box.Youcannowusethewrapperelementasascript'sor
style'sselector;see"UsingtheTextScriptWizard"onpage729and"Stylingandformatting"on
page671.
TheTextScriptWizardhasanExpandbuttonthatopenstheScript Editor,whereyoucaneditthe
codeoraddyourown.(Foranintroduction,see"Writingyourownscripts"onpage808).
Whenyoudouble-clickontheInvoice Metascript,theScriptEditoropensimmediately.Thisscript
showshowtoadddatausingthereplace()method(seehttps://www.w3schools.com/jsref/jsref_
replace.asp).
NotethatthisisanativeJavaScriptfunction.FunctionsthatareonlyavailableinDesignerscriptsare
listedinthe"DesignerScriptAPI"onpage1168.
Dynamic Table
ThetableintheinvoiceisaDynamicTable.Itisfilledandexpandeddynamicallybythescriptsinthe
Productsfolder.Tolearnhowtoinsertandeditsuchatable,see"DynamicTable"onpage742.
Notethatthistabledoesnotuseoneofthedefaulttablestyles,andthatthestylesheetwiththedefault
tablestylesisnotpresentinthetemplate.Toaddthatstylesheettothetemplate,insertatableusing
theDynamicTablewizard.
The data mapping configuration
ThetemplateismergedwithdatafromanXMLfile:SampleData.xml.TheyareextractedfromtheXML
filewithadatamappingconfiguration,madewiththeDataMapper(see"TheDataMapper"on
Page 155