This article deals with the TAL functions of the following objects:
Smartlink
Access to smart links
In eMailings, LeadPages, websites and SVG graphics a smartlink can be accessed via the function getSmartlink.
THIS/getSmartlink/<id>
See also
Functions of Smart Links
hasLinks
Indicates whether the current Smartlink contains links.
Syntax
<smartlink>/getLinklist/hasLinks
Return value
Boolean
Use
<div>smartlink contains links/div>
<div>smartlink is empty div>
See also:
getLinks
Returns a list of links of the current smart link.
Syntax
<smartlink>/getLinklist/getLinks
Return value
Use
<a tal:repeat="link THIS/getSmartlink/23236717/getLinklist/getLinks" tal:content="link/getText" tal:attributes="href link/getLink" href="#"> </a>
<a href="https://scnem.com/slt.php?t=nozc8o.29sf3nf">Example link 1</a> <a href=
"https://scnem.com/slt.php?t=nozce2.2nmrjj8">Example link 2</a> <a href=
"https://scnem.com/slt.php?t=nozce3.9qrr0g">Example link 3</a>
See also:
getCount
Returns the number of links of the current smart link.
Syntax
<smartlink>/getLinklist/getCount
Return value
Use
<div tal:content="THIS/getSmartlink/23236717/getLinklist/getCount"> </div>
<div>3/div>
See also:
Link
A list of links is the return value of the "getLinks" function of a smart link.
getText
Returns the link text of the current link object.
Syntax
<link>/getText
Return value
Use
<a tal:repeat="link THIS/getSmartlink/23236717/getLinklist/getLinks" tal:content="link/getText" tal:attributes="href link/getLink" href="#"> </a>
<a href="https://scnem.com/goto.php?l=nnz6ag.21bjtgk,u=1321445498c9f3845e55ba073bc67b96,n=dskt3.14tt7jk,art_id=dsz0k.258j62">Link 1</a> <a href=
"https://scnem.com/goto.php?l=nnz6ah.132l630,u=1321445498c9f3845e55ba073bc67b96,n=dskt3.14tt7jk,art_id=dsz0k.258j62">Link 2</a> <a href=
"https://scnem.com/goto.php?l=nnz6ai.1ojn4br,u=1321445498c9f3845e55ba073bc67b96,n=dskt3.14tt7jk,art_id=dsz0k.258j62">Link 3</a>
See also:
getLink, getUrl
Returns the link target of the current link object.
Syntax
<link>/getLink<link>/getUrl
Return value
Use
<a tal:repeat="link THIS/getSmartlink/23236717/getLinklist/getLinks" tal:content="link/getText" tal:attributes="href link/getLink" href="#"> </a>
<a href="https://scnem.com/goto.php?l=nnz6ag.21bjtgk,u=1321445498c9f3845e55ba073bc67b96,n=dskt3.14tt7jk,art_id=dsz0k.258j62">Link 1</a> <a href=
"https://scnem.com/goto.php?l=nnz6ah.132l630,u=1321445498c9f3845e55ba073bc67b96,n=dskt3.14tt7jk,art_id=dsz0k.258j62">Link 2</a> <a href=
"https://scnem.com/goto.php?l=nnz6ai.1ojn4br,u=1321445498c9f3845e55ba073bc67b96,n=dskt3.14tt7jk,art_id=dsz0k.258j62">Link 3</a>
See also:
getTrackLink
Returns an individually trackable link for the current link object.
Syntax
<link>/getTrackLink
Return value
Use
<a tal:repeat="link THIS/getAttributeByName/LINKLIST/getValueRaw" href="#" tal:content="link/getText" tal:attributes="href link/getTrackLink"> </a>
<a href="https://scnem.com/goto.php?l=nnz6ag.21bjtgk,u=1321445498c9f3845e55ba073bc67b96,n=dskt3.14tt7jk,art_id=dsz0k.258j62">Link 1</a> <a href=
"https://scnem.com/goto.php?l=nnz6ah.132l630,u=1321445498c9f3845e55ba073bc67b96,n=dskt3.14tt7jk,art_id=dsz0k.258j62">Link 2</a> <a href=
"https://scnem.com/goto.php?l=nnz6ai.1ojn4br,u=1321445498c9f3845e55ba073bc67b96,n=dskt3.14tt7jk,art_id=dsz0k.258j62">Link 3</a>
See also:
System objects
Access to system objects
The function getCategoryContent can be used to access the objects of a system folder. This function is available in eMailings/LeadPages, forms and websites/SVGs.
THIS/getCategoryContent/<sorting>/<id>
See also
Functions of system objects
getDescription
Returns the name of the current system object.
Syntax
<object>/getDescription
Return value
Use
<div tal:content="object/getDescription" tal:repeat="object THIS/getCategoryContent/byDescription/123456"> </div>
<div>name article 1</div> <div>name
article 2</div> <div>name form 1</div>
<div>name SVG-graphic 1</div> <div> name
website 1</div>
See also:
getId
Returns the ID of the current system object.
Syntax
<object>/getId
Return value
Use
<div tal:content="object/getId" tal:repeat="object THIS/getCategoryContent/byDescription/123456"> </div>
<div>2345345</div> <div>7895464</div>
<div>4568456</div> <div>9458670/div>
<div>4568945</div>
See also:
getComment
Returns the comment of the current system object. Not all object types offer the possibility to store a comment or description.
Syntax
<object>/getComment
Return value
Use
<div tal:content="object/getComment" tal:repeat="object THIS/getCategoryContent/byDescription/1667869"> </div>
<div>This is the comment of a smartlink</div> <div>This is
the comment of an article import</div> <div>This is the
comment of a form</div>
See also:
getURL
Returns the system URL of the current system object.
Syntax
<object>/getURL
Return value
Use
<a href="#" tal:attributes="href object/getURL" tal:content="object/getDescription" tal:repeat="object THIS/getCategoryContent/byDescription/1667869"> </a>
<a href="https://scnem.com/art_resource.php?sid=dsz0k.258j62">name Article 1</a> <a href=
"https://scnem.com/art_resource.php?sid=dsz0l.2k5c3b2">name Article 2</a> <a href=
"https://scnem.com/art_resource.php?sid=dsz0m.ir37a9">name Article 3</a> <a href=
"https://scnem.com/art_resource.php?sid=duvuo.10ogbh7">website</a>
See also:
renderResource
Returns the HTML source code of the current system object.
Syntax
<object>/renderResource/<template>
Parameters
template = ID of the article template
Return value
Note
renderResource is only supported by article objects. If an article is rendered in this way, it lacks the corresponding e-mailing or LeadPage object. This means that a number of TAL functions (for example getNewsletter) are not available.
Use
<div tal:content="structure object/renderResource/22116111" tal:repeat="object THIS/getCategoryContent/byDescription/1667869"> </div>
<Div div div div div h1 headline article 1 h1 p...
See also:
Browser
Accessing the Browser
With the function getBrowser the browser (user-agent) of the current visitor/recipient can be accessed. This function is available in eMailings/LeadPages, forms and websites/SVGs.
THIS/getBrowser
See also
Note
To determine the browser and its properties, the browser's user agent is evaluated. However, this is not always and not always correctly output by the browser. In this respect, the functions of the browser object have only limited reliability.
Functions of Browser Objects
getName
Returns the name of the browser.
Syntax
<browser>/getName
Return value
Use
<div tal:content="THIS/getBrowser/getName"> </div>
<div>chrome/div>
See also:
isFirefox
Indicates whether the current browser is a Firefox.
Syntax
<browser>/isFirefox
Return value
Boolean
Use
<div>firefox/div>
<div>no Firefox
See also:
isIE
Indicates whether the current browser is an Internet Explorer.
Syntax
<browser>/isIE
Return value
Boolean
Use
<div>Internet Explorer
<div>no Internet Explorer>/div>
See also:
isSafari
Indicates whether the current browser is a Safari.
Syntax
<browser>/isSafari
Return value
Boolean
Use
<div>safari>/div>
<no safari div
See also:
isChrome
Specifies whether the current browser is a chrome.
Syntax
<browser>/isChrome
Return value
Boolean
Use
<div>chrome/div>
<div>no chrome
See also:
isMS Office
Specifies whether the current browser is Microsoft Office (for example Outlook).
Syntax
<browser>/isSOffice
Return value
Boolean
Use
<div>office
<div>no office>/div>
See also:
isIphone
Indicates whether the current browser is running on an iPhone.
Syntax
<browser>/isIphone
Return value
Boolean
Use
<div>iPhone>/div>
<div>no iPhone>/div>
See also:
isIpad
Specifies whether the current browser is running on an iPad.
Syntax
<browser>/isIpad
Return value
Boolean
Use
<div>iPad>/div>
<div>no iPad>/div>
See also:
isAndroid
Specifies whether the current browser is running on an Android device.
Syntax
<browser>/isAndroid
Return value
Boolean
Use
<div> android
<div>no android
See also:
isMobileDevice
Specifies whether the current browser is running on a mobile device.
Syntax
<browser>/isMobileDevice
Return value
Boolean
Use
<div>mobile/div>
<div>not mobile/div>
See also:
isMac
Specifies whether the current browser is running on a Mac.
Syntax
<browser>/isMac
Return value
Boolean
Use
<div>Mac/div>
<div>no Mac>/div>
See also:
isWindows
Specifies whether the current browser is running on Windows.
Syntax
<browser>/isWindows
Return value
Boolean
Use
<div>Windows
<div>no Windows>/div>
See also:
isLinux
Specifies whether the current browser is running on Linux.
Syntax
<browser>/isLinux
Return value
Boolean
Use
<div>Linux/div>
<div>no Linux/div>
See also:
Date
Access to date
There are several functions that return a date.
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Functions of Date
getEpoch
Returns the number of seconds since the UNIX epoch for the date.
Syntax
<date>/getEpoch
Return value
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getEpoch"> </div>
<div>1234567890</div>
See also:
isFirstQuarter
Indicates whether the date is in the first quarter of the year.
Syntax
<date>/isFirstQuarter
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div>first quarter/div>
<div>not first quarter/div>
See also:
isSecondQuarter
Indicates whether the date is in the second quarter of the year.
Syntax
<date>/isSecondQuarter
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div>second quarter/div>
<div> not second quarter/div>
See also:
isThirdQuarter
Indicates whether the date is in the third quarter of the year.
Syntax
<date>/isThirdQuarter
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<third quarter/div
<div>not third quarter/div>
See also:
isFourthQuarter
Indicates whether the date is in the fourth quarter of the year.
Syntax
<date>/isFourthQuarter
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div>fourth quarter/div>
<div>not fourth quarter/div>
See also:
isNorthernSpring
Indicates if the date is in the spring of the northern hemisphere.
Syntax
<date>/isNorthernSpring
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<Northern spring div
<div>non northern spring
See also:
isNorthernSummer
Indicates if the date is in the summer of the northern hemisphere.
Syntax
<date>/isNorthernSummer
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<northern summer
<div>non northern summer
See also:
isNorthernAutumn
Indicates if the date is in the autumn of the northern hemisphere.
Syntax
<date>/isNorthernAutumn
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<northern autumn/div
<div>non northern autumn
See also:
isNorthernWinter
Indicates if the date is in the winter of the northern hemisphere.
Syntax
<date>/isNorthernWinter
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<northern winter/div
<div>non northern winter
See also:
isSouthernSpring
Indicates if the date is in spring of the southern hemisphere.
Syntax
<date>/isSouthernSpring
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div>southern spring div>
<div>not southern spring div>
See also:
isSouthernSummer
Indicates if the date is in the summer of the southern hemisphere.
Syntax
<date>/isSouthernSummer
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div>southern summer
<div>not southern summer
See also:
isSouthernAutumn
Indicates if the date is in the autumn of the southern hemisphere.
Syntax
<date>/isSouthernAutumn
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div>southern autumn
<div>not southern autumn
See also:
isSouthernWinter
Indicates if the date is in the winter of the southern hemisphere.
Syntax
<date>/isSouthernWinter
Return value
Boolean
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div>southern winter/div>
<div>not southern winter
See also:
getNorthernSeasonCSSClass
Returns the CSS class for the season of the date in the northern hemisphere.
Syntax
<date>/getNorthernSeasonCSSClass
Return value
"winter", "spring", "summer" or "autumn"
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getNorthernSeasonCSSClass"> </div>
<div>autumn>/div>
See also:
getSouthernSeasonCSSClass
Returns the CSS class for the season of the date in the southern hemisphere.
Syntax
<date>/getSouthernSeasonCSSClass
Return value
"winter", "spring", "summer" or "autumn"
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getSouthernSeasonCSSClass"> </div>
<div>spring>/div>
See also:
getDate
Returns the date as text.
Syntax
<date>/getDate
Return value
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getDate"> </div>
<div>01.01.2001</div>
See also:
getYear
Returns the year of the date.
Syntax
<date>/getYear
Return value
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getYear"> </div>
<div>2001/div>
See also:
getYearTwoDigits
Returns the last two digits of the year for the date.
Syntax
<date>/getYearTwoDigits
Return value
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getYearTwoDigits"> </div>
<div>01/div>
See also:
getMonth
Returns the month of the date as a number.
Syntax
<date>/getMonth
Return value
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getMonth"> </div>
<div>01/div>
See also:
getDay
Returns the day of the date as a number.
Syntax
<date>/getDay
Return value
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getDay"> </div>
<div>01/div>
See also:
getMonthName
Returns the month of the date as text.
Syntax
<date>/getMonthName/<language>
Parameters
language = ISO language code, if no language is specified, the object language is used.
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Return value
Use
<div tal:content="THIS/getCurrentDate/getMonthName/en"> </div>
<div>October/div>
See also:
getHour24Format
Returns the hour of the date, in 24 hour format.
Syntax
<date>/getHour24Format
Return value
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getHour24Format"> </div>
<div>13/div>
See also:
getHour12Format
Returns the hour of the date, in 12 hour format.
Syntax
<date>/getHour12Format
Return value
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getHour12Format"> </div>
<div>01/div>
See also:
getMinutes
Returns the minute of the date.
Syntax
<date>/getMinutes
Return value
Note
Since the system works globally and thus in all time zones, all time data are, unless otherwise specified, in the Coordinated Universal Time / UTC (see Wikipedia).
Use
<div tal:content="THIS/getCurrentDate/getMinutes"> </div>
<div>27/div>
See also:
URL parameter/REQUEST
Access to the URL parameters
URL parameters can be accessed using the REQUEST object. It is available in the article, e-mailing or LeadPage template, SVGs, websites and in forms.
REQUEST/<parameter>
Parameters
parameter = Name of the URL parameter
Return value
Note
When accessing URL parameters, you should always consider the case that the parameter is not available. One possibility is a fallback using TAL expression chains.
Use
<div tal:content="REQUEST/f|string:fallback"> </div>
<div>999/div>
Example unsubscribe link for 2-click unsubscribe
If, for example, a LeadPage is used as a 2-click unsubscribe page, the unsubscribe link must be created from parameters transmitted by the mailing. must be created from parameters that are transmitted by the mailing. These parameters are called n, o_sid and u. These parameters are automatically appended to the URL of the of the 2-click unsubscribe from the emailing configuration and can be used with the following and can be used with the following valley code.
<a href="#" tal:attributes="href string:/delete.php?n=${REQUEST/n|string:},sid=${REQUEST/o_sid|string:},u=${REQUEST/u|string:}">unsubscribe</a>
<a href="/delete.php?n=xxx,sid=xxx,u=xxx">unsubscribe</a>
See also:
- tal:content (official TAL documentation)
- tal:expression chains (official TAL documentation)
- Practical example: Consider URL parameters for link to online version
Text
There are two different functions that can be applied to strings. On the one hand string functions offered by objects. On the other hand there are extensions of the TAL operators that can be applied to strings.
String functions
String functions are provided by various objects.
Equals
Specifies whether the return value of a function corresponds to a string.
Syntax
<object>/equals/<method>/<string>
Parameters
method = Name of the method of the current object whose return value is to be compared
string = The text with which the return value is to be compared
Return value
Boolean
Use
<div tal:condition="THIS/equals/getNewsletterDate/28.10.2019">The newsletter is from 28.10.2019</div> <div tal:
condition="not:THIS/equals/getNewsletterDate/28.10.2019">The newsletter is not from 28.10.2019</div>
<div>The newsletter is from 28.10.2019</div>
<div>The newsletter is not from 28.10.2019</div>
See also:
contains
Specifies whether the return value of a function contains a string. Upper and lower case is not considered.
Syntax
<object>/contains/<method>/<string>
Parameters
method = Name of the method of the current object whose return value is to be searched
string = The text to search for in the return value.
Return value
Boolean
Use
<div tal:condition="THIS/contains/getNewsletterDate/2019">The newsletter is from the year 2019</div> <div tal:
condition="not:THIS/contains/getNewsletterDate/2019">The newsletter is not from the year 2019</div>
<div>The newsletter is from the year 2019</div>
<div>The newsletter is not from the year 2019</div>
See also:
isEmpty
Specifies whether the return value of a function is empty.
Syntax
<object, is empty, method, dummy.
Parameters
method = Name of the method of the current object whose return value is to be searched
dummy = All string functions expect two parameters The second parameter, also called dummy parameter, can contain anything (for example "dummy") but can also be left empty.
Return value
Boolean
Use
<div tal:condition="THIS/isEmpty/getSubjectForCurrentUser/dummy">The subject is empty!</div> <div tal:
condition="not:THIS/isEmpty/getSubjectForCurrentUser/dummy">The subject is set.</div>
<Subject is blank.
<div>the subject is set. div>
See also:
toLower
Returns the return value of a function and converts all uppercase letters to lowercase letters.
Syntax
<object, toower, method, dummy.
Parameters
method = Name of the method of the current object whose return value should be converted to lower case
dummy = All string functions expect two parameters. The second parameter, also called dummy parameter, can contain anything (for example "dummy") but can also be left empty.
Return value
Use
<div tal:content="THIS/toLower/getSubjectForCurrentUser/dummy"> </div>
<div>subject of the emailing</div>
See also:
toUpper
Returns the return value of a function and converts all lower case letters to upper case.
Syntax
<object, topper, method, dummy.
Parameters
method = Name of the method of the current object whose return value is to be converted to upper case
dummy = All string functions expect two parameters. The second parameter, also called dummy parameter, can contain anything (for example "dummy") but can also be left empty.
Return value
Use
<div tal:content="THIS/toUpper/getSubjectForCurrentUser/dummy"> </div>
<Subject-matter of the e-mail
See also:
maxlen
Returns the return of a function, shortened to a defined length.
Syntax
<object>/maxlen/<method>/<length>
Parameters
method = Name of the method of the current object whose return value is to be truncated
length = Number of characters from which the return value should be truncated
Return value
Use
<div tal:content="THIS/maxlen/getSubjectForCurrentUser/10"> </div>
<Subject div''?
See also:
TAL operators for strings
TAL operators are available in every TAL command.
equals
Specifies whether two strings are identical.
Syntax
equals:string:<string1>/<string2>
Parameters
string1 = the first text for the comparison
string2 = the second text for the comparison
Return value
Boolean
Use
<div tal:condition="equals:string:${nlDate}/${date}" tal:define="nlDate THIS/getNewsletterDate; date string:28.10.2019">The newsletter is from 28.10.2019</div> <div
tal:condition="not:equals:string:${nlDate}/${date}" tal:define="nlDate THIS/getNewsletterDate; date string:28.10.2019">The newsletter is not from 28.10.2019</div>
<div>The newsletter is from 28.10.2019</div>
<div>The newsletter is not from 28.10.2019</div>
See also:
quotenltobr
Replaces the wraps in the given string with <br> tags and returns it. This is necessary if breaks are not set as HTML source code, but should be output as such. (see Text Fields Multiple line entries
Syntax
quotenltobr:<string>
Parameters
string = The text of which, wraps are to be converted
Return value
Use
<div tal:content="structure quotenltobr:THIS/getTextAreas/0"> </div>
<div>content from text field 0.<br /> even more
content from text field 0.</div>
See also:
htmltofo
Converts a formatted HTML code into XSLT-FO code
Syntax
htmltofo:<string>
Parameters
string = Code to be converted
Return value
Use
<div tal:content="structure httptofo:string:test<br />test"></div>
See also:
httpToHttps
Converts an HTTP url to HTTPS and returns it.
Syntax
httpToHttps:<string>
Parameters
string = Url to be converted
Return value
Use
<a tal:attributes="href httpToHttps:string:http://www.example.de" href="#">example link </a>
<a href="https://www.example.de">example link </a>
See also:
containsString
Searches for a string within another string.
Syntax
containsString:string:<string1>/<string2>
Parameters
string1 = The text to be searched
string2 = The text to search for in string1
Return value
Boolean
Use
<div tal:define="string1 THIS/getNewsletterDate; string2 string:2019"> <div
tal:condition="containsString:string:${string1}/${string2}">The newsletter is from the year 2019</div> <div tal:
condition="not:containsString:string:${string1}/${string2}">The newsletter is not from the year 2019</div> </div>
<The newsletter is from the year 2019
<The newsletter is not from the year 2019
See also:
Numbers
Besides the string functions and operators, there are more operators available, which are intended for numbers.
greaterthan
Specifies whether a value is greater than another value.
Syntax
greaterthan:string:<value1>/<value2>
Parameters
value1 = First value for comparison
value2 = Second value for comparison
Return value
Boolean
Use
<div tal:condition="greaterthan:string:2019/${THIS/getNewsletterDate/getYear}">The newsletter was edited before 2019.</div> <div tal:
condition="not:greaterthan:string:2019/${THIS/getNewsletterDate/getYear}">The newsletter was edited 2019 or later.</div>
<div>The newsletter was edited before 2019.</div>
<div>The newsletter was edited in 2019 or later.</div>
See also:
lessthan
Specifies whether a value is smaller than another value.
Syntax
lessthan:string:<value1>/<value2>
Parameters
value1 = First value for comparison
value2 = Second value for comparison
Return value
Boolean
Use
<div tal:condition="lessthan:string:${THIS/getNewsletterDate/getYear}/2019">The newsletter was edited before 2019.</div> <div tal:
condition="not:lessthan:string:${THIS/getNewsletterDate/getYear}/2019">The newsletter was edited 2019 or later.</div>
<div>The newsletter was edited before 2019.</div>
<div>The newsletter was edited in 2019 or later.</div>
See also:
add
Returns the sum of two given numbers.
Syntax
THIS/getApi/math/add/<value1>/<value2>
Parameter
value1 = Number to be added
value2 = Number to be added
Return value
Number
Use
- eMailing
- LeadPage
- Form
- Website, PDF, SVG
<div tal:content="THIS/getApi/math/add/10/2"> </div>
<div>12</div>
Siehe auch:
sub
Returns the difference of two given numbers.
Syntax
THIS/getApi/math/sub/<value1>/<value2>
Parameter
value1 = Number from which to subtract
value2 = Number to be subtracted
Return value
Number
Use
- eMailing
- LeadPage
- Form
- Website, PDF, SVG
<div tal:content="THIS/getApi/math/sub/10/2"> </div>
<div>8</div>
See also:
mul
Returns the product of two given numbers.
Syntax
THIS/getApi/math/mul/<value1>/<value2>
Parameter
value1 = Number to be multiplied
value2 = Number to be multiplied
Return value
Number
Use
- eMailing
- LeadPage
- Form
- Website, PDF, SVG
<div tal:content="THIS/getApi/math/mul/10/2"> </div>
<div>20</div>
See also:
div
Returns the quotient of two given numbers.
Syntax
THIS/getApi/math/div/<value1>/<value2>
Parameter
value1 = Number to be divided
value2 = Number by which to divide
Return value
Number
Use
- eMailing
- LeadPage
- Form
- Website, PDF, SVG
<div tal:content="THIS/getApi/math/div/10/2"> </div>
<div>5</div>
See also:
round
Rounds a given number to a given number of digits.
Syntax
THIS/getApi/math/round/<value>/<digits>
Parameter
value = Number to be rounded
digits = Number of decimal places to which rounding is to be performed.
Return value
Number
Use
- eMailing
- LeadPage
- Form
- Website, PDF, SVG
<div tal:content="THIS/getApi/math/round/123.456678/3"> </div>
<div>123.456</div>
See also:
ceil
Returns the smallest integer that is greater than or equal to the given number (round up).
Syntax
THIS/getApi/math/ceil/<value>
Parameter
value = Number to be rounded up
Return value
Number
Use
- eMailing
- LeadPage
- Form
- Website, PDF, SVG
<div tal:content="THIS/getApi/math/ceil/123.456678"> </div>
<div>124</div>
See also:
floor
Returns the largest integer that is less than or equal to the given number (rounding down).
Syntax
THIS/getApi/math/floor/<value>
Parameter
value = Number to be rounded down
Return value
Number
Use
- eMailing
- LeadPage
- Form
- Website, PDF, SVG
<div tal:content="THIS/getApi/math/floor/123.456678"> </div>
<div>123</div>
See also:
XML object
Access to an XML object
In an eMailing or LeadPage the XML object can be accessed via the function getExternalXml.
THIS/getExternalXml
See also
Functions of the XML object
The XML object provides access to nodes, their children and attributes using a predefined syntax rather than commands.
Nodes/subnodes
A node of the XML can be reached by using the entire XML path in the form of a TAL path.
Syntax
<Node... Node one...
Parameters
node1-n = Name of the nodes from the first to the searched subnode
Return value
Use
<div tal:content="THIS/getExternalXml/some_text_node"> </div> <div tal:
content="THIS/getExternalXml/some_node_with_childs/next_level/next_level"> </div> <div tal:
content="structure xml/some_node_with_cdata"> </div>
<?xml version="1.0" encoding="utf-8"?> <root>
<some_text_node>any
text</some_text_node> <some_node_with_childs>
<next_level> <next_level>any
text
- but deeper in the tree</next_level> <
/next_level> </some_node_with_childs>
<more_than_one_node> 1</more_than_one_node>
<more_than_one_node> 2</more_than_one_node>
<more_than_one_node> 3</more_than_one_node>
<
more_than_one_node_with_childs> <child>1</child>
</more_than_one_node_with_childs>
<more_than_one_node_with_childs>
<child>2</child> </more_than_one_node_with_childs>
<more_than_one_node_with_childs> <child>3</child>
</more_than_one_node_with_childs>
<some_node_with_attributes
attribute="Any attribute" /> <some_node_with_cdata><!
CDATA[<h1>Here can also be HTML</h1>]]></some_node_with_cdata> <node_with_links> <a
href=
"http://www.example.com">Example.com</a> <a href=
"http://www.example.com/example">Example.com Example</a> </node_with_links> </root>
<div>any text/div> div> div> any
text - but deeper in the tree div> div> div> div> div> h1>h1>Here can
be HTML h1> div> div>
See also:
Lists of nodes
If there is more than one node with the same name, they can be processed as a list. Access is the same as with simple node access and the suffix "[]".
Syntax
<node>/<node1>...
Parameters
node1-n = Name of the nodes from the first to the searched subnodes
Return value
Use
<ul><li tal:repeat= "node xml/more_than_one_node[]" tal:content= "node" > </li></ul> <ul><li tal
:repeat= "node xml/more_than_one_node_with_childs[]" tal:content= "node/child"
<?xml version="1.0" encoding="utf-8"?> <root>
<some_text_node>any
text</some_text_node> <some_node_with_childs>
<next_level> <next_level>any
text
- but deeper in the tree</next_level> <
/next_level> </some_node_with_childs>
<more_than_one_node> 1</more_than_one_node>
<more_than_one_node> 2</more_than_one_node>
<more_than_one_node> 3</more_than_one_node>
<
more_than_one_node_with_childs> <child>1</child>
</more_than_one_node_with_childs>
<more_than_one_node_with_childs>
<child>2</child> </more_than_one_node_with_childs>
<more_than_one_node_with_childs> <child>3</child>
</more_than_one_node_with_childs>
<some_node_with_attributes
attribute="Any attribute" /> <some_node_with_cdata><!
CDATA[<h1>Here can also be HTML</h1>]]></some_node_with_cdata> <node_with_links> <a
href=
"http://www.example.com">Example.com</a> <a href=
"http://www.example.com/example">Example.com Example</a> </node_with_links> </root>
<ul> <li>1</li>
<li>2</li> <li>3</li>
</ul> <ul> <li>1</li>
<li>2</li> <li>3</li>
</ul>
See also:
Attributes
You can access the attribute of a node with "@".
Syntax
<node>/@<attributes>
Parameters
attribute = Name of the attribute searched for in the current node
Return value
Use
<div tal:content="xml/some_node_with_attribute/@attribute"> </div>
<?xml version="1.0" encoding="utf-8"?> <root>
<some_text_node>any
text</some_text_node> <some_node_with_childs>
<next_level> <next_level>any
text
- but deeper in the tree</next_level> <
/next_level> </some_node_with_childs>
<more_than_one_node> 1</more_than_one_node>
<more_than_one_node> 2</more_than_one_node>
<more_than_one_node> 3</more_than_one_node>
<
more_than_one_node_with_childs> <child>1</child>
</more_than_one_node_with_childs>
<more_than_one_node_with_childs>
<child>2</child> </more_than_one_node_with_childs>
<more_than_one_node_with_childs> <child>3</child>
</more_than_one_node_with_childs>
<some_node_with_attributes
attribute="Any attribute" /> <some_node_with_cdata><!
CDATA[<h1>Here can also be HTML</h1>]]></some_node_with_cdata> <node_with_links> <a
href=
"http://www.example.com">Example.com</a> <a href=
"http://www.example.com/example">Example.com Example</a> </node_with_links> </root>
<div>any attribute
See also:
tracklink
The suffix "/tracklink" replaces links with tracking links.
Syntax
<node>/tracklink
Return value
Use
<div tal:content="structure xml/some_with_links/tracklink"> </div>
<?xml version="1.0" encoding="utf-8"?> <root>
<some_text_node>any
text</some_text_node> <some_node_with_childs>
<next_level> <next_level>any
text
- but deeper in the tree</next_level> <
/next_level> </some_node_with_childs>
<more_than_one_node> 1</more_than_one_node>
<more_than_one_node> 2</more_than_one_node>
<more_than_one_node> 3</more_than_one_node>
<
more_than_one_node_with_childs> <child>1</child>
</more_than_one_node_with_childs>
<more_than_one_node_with_childs>
<child>2</child> </more_than_one_node_with_childs>
<more_than_one_node_with_childs> <child>3</child>
</more_than_one_node_with_childs>
<some_node_with_attributes
attribute="Any attribute" /> <some_node_with_cdata><!
CDATA[<h1>Here can also be HTML</h1>]]></some_node_with_cdata> <node_with_links> <a
href=
"http://www.example.com">Example.com</a> <a href=
"http://www.example.com/example">Example.com Example</a> </node_with_links> </root>
<div> <a href=
"https://scnem.com/goto.php?l=nqwilo.2920q4a,u=8ccc717101048a39,n=dvb7b.3o4r27,art_id=dvb7b.3o4r27">Example.com</a> <a href=
"https://scnem.com/goto.php?l=nqwilp.d4kr92,u=8ccc717101048a39,n=dvb7b.3o4r27,art_id=dvb7b.3o4r27">Example.com Example</a> </div>