Access to the e-mailing or LeadPage object
eMailing-/LeadPage template
In an eMailing/LeadPage template, you access the eMailing- or LeadPage object via THIS:
THIS
Article template
From an article you can access the eMailing- or LeadPage object with getNewsletter or getFullNewsletter respectively.
THIS/getNewsletterTHIS/getNewsletter/getFullNewsletter
See also:
eMailing- and LeadPage functions
The e-mailing or LeadPage object provides a range of functions:
getCategoryId
Returns the ID of the system folder where the current e-mail or lead page is located.
Syntax
THIS/getCategoryId
Return value
Note
When an e-mail is sent, the folder of the sending object is returned here and not the folder in which the e-mail was created/edited.
Use
<div tal:content="THIS/getCategoryId"> </div>
<div>1667869/div>
See also:
getCategoryContent
Returns the objects that are located in a given system folder.
Syntax
THIS/getCategoryContent/<sorting>/<id>
Parameters
sorting = Sorting order, permissible are "byLastModifiedDesc" for sorting by processing date in descending order and "byDescription" for alphabetical sorting by object name
id = ID of the given system folder
Return value
List of objects
Use
<div tal:repeat="object THIS/getCategoryContent/byDescription/1667869" tal:content="object/getDescription"> </div>
<div>name article 1</div> <div>name
article 2</div> <div>name article 3</div>
<div>name SVG-graphic 1</div> <div> name
eMailing 1</div>
See also:
getCurrentUser
Returns the profile of the recipient or the identified profile.
Syntax
THIS/getCurrentUser
Return value
Use
<div tal:content="THIS/getCurrentUser/getValues/NAME"> </div>
<div>Sampleman/div>
See also:
- Profile:getValues
- tal:content (official TAL documentation)
- Practical example: Individualized page title
- Practical example: Select language container based on profile language
- Practical example: Flexible navigation from the link list of the content container
- Practical example: Editorial with personal salutation and table of contents
getSubjectForCurrentUser
Returns the individualized subject for the current recipient.
Syntax
THIS/getSubjectForCurrentUser
Return value
Use
<div tal:content="THIS/getSubjectForCurrentUser"> </div>
<Subject for Mr Max Mustermann
See also:
getMandatorId
Returns the client ID.
Syntax
THIS/getMandatorId
Return value
Use
<div tal:content="THIS/getMandatorId"> </div>
<div>13683/div>
See also:
compareMandatorId
Specifies whether the current TAL script is executed in a given client. For example, if a global e-mail is sent from a local client, getMandatorId returns the ID of the global client.
Syntax
THIS/getApi/getOwnershipAccessor/compareMandatorId/<id>
Return value
Boolean
Use
<div tal:condition="THIS/getApi/getOwnershipAccessor/compareMandatorId/123456">Script is executed in the searched client</div> <div tal:
condition="not:THIS/getApi/getOwnershipAccessor/compareMandatorId/123456">Script is not executed in the searched client</div>
<div>Script will be executed in the searched client</div>
<div>Script is not executed in the client you are looking for</div>
See also:
getContainer
Returns the container with the specified ID.
Syntax
THIS/getContainer/<id>
Parameters
id = Object ID of the container searched for
Return value
Use
<div tal:content="THIS/getContainer/23099936/getAttributeByName/READMORE"> </div>
<div>read more
See also:
getSmartlink
Returns the Smartlink with the specified ID.
Syntax
THIS/getSmartlink/<id>
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:
getCurrentDate
Returns the current date.
Syntax
THIS/getCurrentDate
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"> </div>
<div>11.10.2019</div>
See also:
getNewsletterDate
Returns the date of the last processing of the current eMail or LeadPage.
Syntax
THIS/getNewsletterDate
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/getNewsletterDate"> </div>
<div>11.10.2019</div>
See also:
getHTMLAreas
Returns the desired HTML field of the current eMail or LeadPage.
Syntax
THIS/getHTMLAreas/<n>
Parameters
n = Index of the HTML field being searched
Return value
Use
<div tal:content="structure THIS/getHTMLAreas/0"> </div>
<div><span>content from HTML field 0</span></div>
See also:
getInputFields
Returns the desired input field of the current eMail or LeadPage.
Syntax
THIS/getInputFields/<n>
Parameters
n = Index of the searched input field
Return value
Use
<div tal:content="THIS/getInputFields/0"> </div>
<div>content from input field field 0</div>
See also:
getTextAreas
Returns the desired text field of the current emailing or lead page.
Syntax
THIS/getTextAreas/<n>
Parameters
n = Index of the searched text field
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:
getContentContainer
Returns the content container from the template of the current e-mailing or lead page.
Syntax
THIS/getContentContainer
Return value
Use
<div tal:content="THIS/getContentContainer/getAttributeByName/READMORE"> </div>
<div>multi-read
See also:
hasArticleInAnySlot
Indicates whether an article is contained in any slot of the current e-mail or LeadPage.
Syntax
THIS/hasArticleInAnySlot
Return value
Boolean
Use
<div>articles are available</div>
<eMailing or LeadPage is empty
See also:
getFilledSlots
Returns all slots of the current eMail or LeadPage that contain articles.
Syntax
THIS/getFilledSlots
Return value
List of slot objects
Use
<div tal:repeat="slot THIS/getFilledSlots" tal:content="slot/countArticles"> </div>
<div>4/div> div> div>6/div>
See also:
hasSelectedArticle
Indicates whether the current e-mail or the LeadPage was called with an article. This is the case if the landing page of the template is called up.
Syntax
THIS/hasSelectedArticle
Return value
Boolean
Use
<div tal:condition="THIS/hasSelectedArticle">article is selected</div> <div tal:
condition="not:THIS/hasSelectedArticle">article is not selected</div>
<div>article is selected</div>
<div>article is not selected</div>
See also:
getSelectedArticle
Returns the selected article if the landing page of the current eMailing or lead page was called.
Syntax
THIS/getSelectedArticle
Return value
Use
<div tal:content="THIS/getSelectedArticle/getHeadline"> </div>
<div>heading article 1</div>
See also:
hasSlot
Specifies whether the slot you are looking for is available in the current e-mail or the lead page.
Syntax
THIS/hasSlot<n>
Parameters
n = Index of the desired slot
Return value
Boolean
Use
<div tal:condition="THIS/hasSlot0">Slot 0 is present</div> <div tal:
condition="not:THIS/hasSlot0">Slot 0 is not present</div>
<div>slot 0 is present</div>
<div>Slot 0 is not available</div>
See also:
getSlot
Delivers the slot you are looking for.
Syntax
THIS/getSlot<n>
Parameters
n = Index of the slot searched for (up to a maximum of 9)
Return value
Note
getSlot<n> is the short form of getSlots/<n>, but only slots 0 to 9 can be reached.
Use
<div tal:content="THIS/getSlot0/countArticles"> </div>
<div>4/div>
See also:
hasSlots
Specifies whether any slot exists in the current e-mail or the LeadPage.
Syntax
THIS/hasSlots
Return value
Boolean
Use
<div tal:condition="THIS/hasSlots">Slots are available</div> <div tal:
condition="not:THIS/hasSlots">Slots are not available</div>
<div>Slots are available</div>
<div>Slots are not available</div>
See also:
getSlots
Delivers the slot you are looking for.
Syntax
THIS/getSlots/<n>
Parameters
n = Index of the slot
Return value
Use
<div tal:content="THIS/getSlots/0/countArticles"> </div>
<div>4/div>
See also:
countSlots
Returns the number of slots in the current e-mail or lead page.
Syntax
THIS/countSlots
Return value
Use
<div tal:content="THIS/countSlots"> </div>
<div>1/div>
See also:
getBrowser
Returns the browser with which the current e-mail or lead page is displayed.
Syntax
THIS/getBrowser
Return value
Use
<div tal:content="THIS/getBrowser/getName"> </div>
<div>chrome/div>
See also:
isAnyHTMLMode
Specifies whether the current e-mail or LeadPage is displayed in any HTML-based mode.
Syntax
THIS/isAnyHTMLMode
Return value
Boolean
Use
<div>HTML view/div>
<div>no HTML view/div>
See also:
isAppendMode
Indicates whether the current e-mail or lead page is currently displayed in the visual editor.
Syntax
THIS/isAppendMode
Return value
Boolean
Use
<div>view in the visual editor</div>
<div>view not in visual editor</div>
See also:
- isLandingPage
- isEmailMode
- getIsPdfMode
- isTextMode
- isLPMode
- isWebMode
- isAnyHTMLMode
- isSocialMode
- isFacebookMode
- isGooglePlusMode
- tal:condition (official TAL documentation)
- PHPTALES:not (official TAL documentation)
- Practical example: Using image pickers for header images in the visual editor
- Practical example: Outputting single and multi-column slots with TAL
isEmailMode
Specifies whether the current e-mail or the LeadPage is output in an e-mail.
Syntax
THIS/isEmailMode
Return value
Boolean
Use
<div>Output in e-mailing div>/div>
<div> no output to e-mailing div>/div>
See also:
isFacebookMode
Indicates whether the current e-mail or the LeadPage is displayed on Facebook.
Syntax
THIS/isFacebookMode
Return value
Boolean
Use
<div>advertisement on Facebook/div>
<div>Don't display on Facebook/div>
See also:
isLPMode
Specifies whether the current e-mail or the LeadPage is displayed on a landing page.
Syntax
THIS/isLP mode
Return value
Boolean
Use
<div>display on landing page/div>
<div>Display not on landing page</div>
See also:
getIsPdfMode
Indicates whether the current e-mail or lead page is currently displayed as PDF.
Syntax
THIS/getIsPdfMode
Return value
Boolean
Use
<div>Display as PDF</div>
<div>Display not as PDF</div>
See also:
isSocialMode
Indicates whether the current e-mail or the LeadPage is displayed in a social network.
Syntax
THIS/isSocialMode
Return value
Boolean
Use
<div>advertisement in social network/div>
<div>advertisement not in social network/div>
See also:
isTextMode
Specifies whether the current e-mail or the LeadPage is displayed in a plain text e-mail.
Syntax
THIS/isTextMode
Return value
Boolean
Use
<div>display in text-only e-mail</div>
<div>Display not in text-only email/div>
See also:
isWebMode
Specifies whether the current e-mail or the LeadPage is displayed in a browser.
Syntax
THIS/isWebMode
Return value
Boolean
Use
<div>display in browser/div>
<div>Display not in browser</div>
See also:
getExternalXml
Returns the XML object that was stored in the eMailing/LeadPage configuration.
Syntax
THIS/getExternalXml
Return value
Use
<div tal:content="THIS/getExternalXml/SomeNode"> </div>
<Contents of a node
See also:
hasExternalXML
Checks if there is an XML object stored in the eMailing/LeadPage configuration.
Syntax
THIS/hasExternalXml
Return value
Boolean
Use
<div tal:condition="THIS/hasExternalXML">
<div tal:content="THIS/getExternalXml/SomeNode">
<Contents of a node
See also:
Slot functions
The slot object itself provides a number of functions:
hasArticles
Indicates whether the current slot contains an article.
Syntax
<slot>/hasArticles
Return value
Boolean
Use
<div tal:condition="THIS/getSlots/0/hasArticles">Slot 0 contains articles</div> <div tal:
condition="not:THIS/getSlots/0/hasArticles">Slot 0 is empty</div>
<div>slot 0 contains article</div>
<div>slot 0 is empty</div>
See also:
getArticles
Returns the articles of the current slot.
Syntax
<slot>/getArticles
Return value
List of article references
Use
<div tal:repeat="articleRef THIS/getSlots/0/getArticles" tal:content="articleRef/getArticle/getHeadline"> </div>
<Heading Article 1/div> Heading
Article 2/div> Heading Article 2/div> Heading
Article 3/div> Heading Article 4/div> Heading Article 4/div>
See also:
hasOneArticle
Specifies whether the current slot has exactly one
Syntax
<slot>/hasOneArticle
Return value
Boolean
Use
<div>A article/div>
<div>more or less than one article div>
See also:
hasMoreThanOneArticle
Specifies whether the current slot contains more than one article.
Syntax
<slot>/hasMoreThanOneArticle
Return value
Boolean
Use
<div>More than one article div>
<div>one or no article
See also:
countArticles
Returns the number of items in the current slot.
Syntax
<slot>/countArticles
Return value
Use
<div tal:content="THIS/getSlots/0/countArticles"> </div>
<div>4/div>
See also:
getArticlesInTwoColumns
Returns the articles of the current slot in a 2-column list.
Syntax
<slot>/getArticlesInTwoColumns
Return value
2-column list of article references
Use
<table> <tbody>
<tr tal
:repeat="column THIS/getSlots/0/getArticlesInTwoColumns"> <td tal:
repeat="article column" tal:content="article/getArticle/getHeadline"> </td> </tr> </tbody> </table>
<table> <tbody>
<tr> <td>heading
article 1</td> <td>heading article
2</td> </tr>
<Heading
Article 3 Heading
Article
4 Heading
Article 4
See also:
getArticlesInColumns
Returns the articles of the current slot in a multi-column list.
Syntax
<slot>/getArticlesInColumns/<n>
Parameters
n = number of columns required
Return value
multi-column list of article references
Use
<table> <tbody>
<tr tal:
repeat="row THIS/getSlots/0/getArticlesInColumns/3"> <td tal:
repeat="article row" tal:content="article/getArticle/getHeadline"> </td> </tr> </tbody> </table>
<table> <tbody>
<tr> <td>heading
article 1</td> <td>heading article
2</td> <td>heading article 3</td> </tr>
<Heading
Article 4 Head ing
Article
5 Heading Article
6 Heading Article
6
See also:
renderWithTemplate
Is provided by the article reference object and returns the HTML of an article, based on the specified article template.
Syntax
<article>/renderWithTemplate/<id>
Parameters
id = ID of the article template (optional)
Return value
Note
If no ID is passed for the article template, the alternative template stored in the eMailing/LeadPage is used. If no alternative template is selected, the slot's default template will be used.
Use
<div tal:content="structure THIS/getSlots/0/getArticles/0/renderWithTemplate/23168342"> </div>
<Div div div div div h1 headline article 1 h1 p...