Access to the article object
Article template
In an article template, you access the article object via THIS:
THIS
Landingpage from eMailing-/LeadPage template
In an eMailing/LeadPage landing page template you can reach the selected article via getSelectedArticle/getArticle. If the landing page is displayed via the preview, no article is selected and the TAL function fails.
THIS/getSelectedArticle/getArticle
In an emailing or lead page template, you can also access the article objects via the respective slots. The articles in the slots can be displayed as single-column or multi-column lists.
the k-th article of the slot n
THIS/getSlots/<n>/getArticles/<k>/getArticle
Article reference
The article reference links an object (for example, an e-mail or lead page) to an article. Most functions therefore do not return an article directly, but an article reference. To get the article for an article reference, use getArticle.
<item>/getArticle
See also:
Article functions
The article object provides a range of functions:
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:
hasAttributes
hasAttribute indicates whether the attribute (field) with the specified name exists in the current article.
Syntax
THIS/hasAttribute/<name>
Parameters
name = internal name of the attribute searched
Return value
Boolean
Use
<div>attribute "HEADLINE" available</div>
<div>attribute "HEADLINE" not available</div>
See also:
getAttributeByName
getAttributeByName returns the attribute (field) of the article with the specified internal name.
Syntax
THIS/getAttributeByName/<name>
Parameters
name = internal name of the attribute
Return value
Use
<div tal:content="THIS/getAttributeByName/HEADLINE"> </div>
<div>heading article 1</div>
See also:
getAttributesByType
getAttributesByType returns a list of the attributes of the current article that correspond to the specified type.
Syntax
THIS/getAttributesByType/<type>
Parameters
type = Identifier Attribute type. The following values are supported:TYPE_IMAGE and TYPE_LINKLIST
Return value
List of attributes
Use
<img src="#" alt="" tal:repeat="image THIS/getAttributesByType/TYPE_IMAGE" tal:attributes="src image"/>
<img src="https://scnem.com/art_resource.php?sid=dsokp.2ag693n" alt=""/> <img src=
"https://scnem.com/art_resource.php?sid=dsokp.2ag693n" alt=""/> <img src=
"https://scnem.com/art_resource.php?sid=dsokp.2ag693n" alt=""/> <img src=
"https://scnem.com/art_resource.php?sid=dsokp.2ag693n" alt=""/> <img src=
"https://scnem.com/art_resource.php?sid=dsokp.2ag693n" alt=""/> <img src=
"https://scnem.com/art_resource.php?sid=dsokp.2ag693n" alt=""/>
See also:
getAnchor
getAnchor provides a unique jump label for the current placement of an article. If an article is used more than once in an eMailing or LeadPage, each of the article references receives a unique jump label.
Syntax
THIS/getAnchor
Return value
Note
Jump labels are not supported by all e-mail clients.
Use
<div tal:attributes="id THIS/getAnchor"> </div>
<div id="artref_8394677"> </div>
See also:
getAnchorHRef
getAnchorHRef provides the link to the jump marker of the article within a mailing or lead page. The value is still unique even if the same article is used several times in the direct mailing or lead page.
Syntax
THIS/getAnchorRef
Return value
Note
Jump labels are not supported by all e-mail clients.
Use
<a href="#" tal:attributes="href THIS/getAnchorHRef">Link</a>
<a href="#artref_8394677">Link</a>
See also:
getArticleDate
getArticleDate returns the date of the last editing of the current article.
Syntax
THIS/getArticleDate
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/getArticleDate"> </div>
<div>05.10.2019</div>
See also:
getId
getId returns the object ID of the article.
Syntax
THIS/getId
Return value
Note
If the article has been inserted multiple times, the object ID of the article is unique in the system, but not unique in the e-mail or the LeadPage (see getUniqId
Use
<div tal:content="THIS/getId"> </div>
<div>23186756
See also:
getUniqId
getUniqId returns the unique ID of the article reference. This function can also be applied directly to an article reference.
Syntax
THIS/getUniqId
Return value
Note
The unique ID of the article reference is not equal to the object ID of the article. It is used to uniquely identify articles that are used several times in an e-mail or on a landing page (see getId
Use
<div tal:content="THIS/getUniqId"> </div>
<div>8394680/div>
See also:
getName
getName returns the internal name for the current article.
Syntax
THIS/getName
Return value
Note
The Name field is only intended for working within the system and should not be output. Instead, you should use the article heading, for example, for output.
Use
<div tal:content="THIS/getName"> </div>
<div>name article 1/div>
See also:
getMandatorId
Returns the client ID.
Syntax
THIS/getMandatorId
Return value
Use
<div tal:content="THIS/getMandatorId"> </div>
<div>13683/div>
See also:
getAuthor
Returns the value from the "Author" field from the current article. The Author field is located in the Optional section at the end of the item.
Syntax
THIS/getAuthor
Return value
Use
<div tal:content="THIS/getAuthor"> </div>
<div>first name last name/div>
See also:
hasHeadline
hasHeadline indicates whether a headline is set in the current article.
Syntax
THIS/hasHeadline
Return value
Boolean
Note
hasHeadline is the shorthand for the field with the role "Headline". Instead, getAttributeByName should be used to get the value of the desired field (see Roles in Article Type).
Use
<div tal:condition="THIS/hasHeadline">heading present</div> <div tal:
condition="not:THIS/hasHeadline">heading not present</div>
<div>heading available</div>
<div>heading not available</div>
See also:
getHeadline
getHeadline returns the headline from the current article.
Syntax
THIS/getHeadline
Return value
Note
getHeadline is the shorthand for the field with the role "Headline". Instead getAttributeByName should be used to get the value of the desired field (see roles in the article type).
Use
<div tal:content="THIS/getHeadline"> </div>
<div>heading article 1</div>
See also:
hasImage
hasImage indicates whether an image is stored for the article.
Syntax
THIS/hasImage
Return value
Boolean
Note
hasImage is the shorthand for the field with the role "Image". Instead, getAttributeByName should be used to get the value of the desired field (see Roles in Article Type),
Use
<div tal:condition="THIS/hasImage">image present</div> <div tal:
condition="not:THIS/hasImage">no image present</div>
<div>image available/div>
<div>no image available/div>
See also:
getImageUrl
getImageUrl delivers the integration URL to the image of the current article.
Syntax
THIS/getImageUrl
Return value
Note
getImageUrl is the short form of the URL from the field with the role "image". Instead, getAttributeByName should be used to get the value of the desired field (see roles in the article type).
Use
<img alt="" src="#" tal:attributes="src THIS/getImageUrl"/>
<img alt="" src="https://scnem.com/a.php?sid=dsokp.2ag693n"/>
See also:
countLinks
countLinks indicates how many links are in the link list of the current article.
Syntax
THIS/countLinks
Return value
Use
<div tal:content="THIS/countLinks"> </div>
<div>4/div>
See also:
hasLinks
hasLinks indicates whether links are set in the current article.
Syntax
THIS/hasLinks
Return value
Boolean
Note
hasLinks is the shorthand for the field with the role "link list". Instead, getAttributeByName should be used to get the value of the desired field (see Roles in Article Type).
Use
<div>link available/div>
<div>link not available div>
See also:
getLinks
getLinks returns the link list of the current article.
Syntax
THIS/getLinks
Return value
Note
getLinks is the shorthand for the field with the role "link list". Instead, getAttributeByName should be used to get the value of the desired field (see Roles in Article Type).
Use
<a href="#" tal:repeat="link THIS/getLinks" tal:attributes="href link/getUrl" tal:content="link/getText"> </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> <a href=
"https://scnem.com/goto.php?l=nnz6aj.18ni7tp,u=1321445498c9f3845e55ba073bc67b96,n=dskt3.14tt7jk,art_id=dsz0k.258j62">Link 4</a>
See also:
hasShortText
hasShortText indicates whether a short text is filled for the current article.
Syntax
THIS/hasShortText
Return value
Boolean
Note
hasShortText is the short form of the field with the role "short text". Instead, getAttributeByName should be used to get the value of the desired field. (see roles in the article type)
Use
<div tal:condition="THIS/hasShortText">short text available</div> <div tal:
condition="not:THIS/hasShortText">short text not available</div>
<div>short text available</div>
<div>short text not available</div>
See also:
getShortText
getShortText returns the short text of the current article.
Syntax
THIS/getShortText
Return value
Note
getShortText is the short form of the field with the role "short text". Instead, getAttributeByName should be used to get the value of the desired field (see Roles in Article Type).
Use
<div tal:content="structure THIS/getShortText"> </div>
<div>Lorem ipsum dolor sit amet, consetetur sadipscing elitr.</div>
See also:
hasLongText
hasLongText specifies whether the long text is filled for the current article.
Syntax
THIS/hasLongText
Return value
Boolean
Note
hasLongText is the short form of the field with the role "long text". Instead, getAttributeByName should be used to get the value of the desired field (see Roles in Article Type).
Use
<div tal:condition="THIS/hasLongText">long text available</div> <div tal:
condition="not:THIS/hasLongText">long text not available</div>
<div>long text available/div>
<div>long text not available</div>
See also:
getLongText, getText
getLongText or getText returns the long text of the current article.
Syntax
THIS/getLongText
or
THIS/getText
Return value
Note
getLongText or getText is the short form of the field with the role "long text". Instead, getAttributeByName should be used to get the value of the desired field (see roles in the article type).
Use
<div tal:content="structure THIS/getLongText"> </div> <div tal:content=
"structure THIS/getText"> </div>
<div>long text article 1/div> div> div>long text
article 1/div>
See also:
getReadLpUrl
getReadLpUrl returns the URL to the landing page generated from the template.
Syntax
THIS/getReadLpUrl
Return value
Use
<a href="#" tal:attributes="href THIS/getReadLpUrl">read more...</a>
<a href="https://scnem.com/a.php?sid=dskt3.14tt7jk,f=5,n=dskt3.14tt7jk,artref=8394682,l=noescg.1d8gg84">read more...</a>
See also:
hasLandingPage
hasLandingPage specifies whether an external landing page link or a long text exists for the current article.
Syntax
THIS/hasLandingPage
Return value
Boolean
Use
<div tal:condition="THIS/hasLandingPage">Landingpage available</div> <div tal:
condition="not:THIS/hasLandingPage">Landingpage not available</div>
<div>Landingpage available</div>
<div>Landingpage not available</div>
See also:
getReadLpLinkOrLpUrl
getReadLpLinkOrLpUrl returns the landing page link of the current article. If this is not set but a long text exists, the link is delivered to the landing page generated from the template.
Syntax
THIS/getReadLpLinkOrLpUrl
Return value
Use
<a href="#" tal:attributes="href THIS/getReadLpLinkOrLpUrl">read more...</a>
<a href="https://scnem.com/a.php?sid=dskt3.14tt7jk,f=6,n=dskt3.14tt7jk,artref=8394677,l=nn7xyn.1l9bo3i">read more...</a>
See also:
hasLandingPageLink
hasLandingPageLink indicates whether an external landing page link exists for the current article.
Syntax
THIS/hasLandingPageLink
Return value
Boolean
Use
<div tal:condition="THIS/hasLandingPageLink">Landingpagelink available</div> <div tal:
condition="not:THIS/hasLandingPageLink">Landingpagelink not available</div>
<div>Landingpagelink available</div>
<div>landingpagelink not available div>
See also:
getReadLpLinkUrl
getReadLpLinkUrl returns the external landing page link of the current article.
Syntax
THIS/getReadLpLinkUrl
Return value
Use
<a href="#" tal:attributes="href THIS/getReadLpLinkUrl">read more...</a>
<a href="https://scnem.com/a.php?sid=dskt3.14tt7jk,f=6,n=dskt3.14tt7jk,artref=8394682,l=nn7xyq.1a5rd8h">read more...</a>
See also:
getReadPdfUrl
getReadPdfUrl returns the link to the PDF version of the current article.
Syntax
THIS/getReadPdfUrl
Return value
Use
<a href="#" tal:attributes="href THIS/getReadPdfUrl">Download</a>
<a href="https://scnem.com/a.php?sid=dskt3.14tt7jk,f=2,n=dskt3.14tt7jk,artref=8394677,l=noet37.2piol46">download</a>
See also:
getNewsletter
getNewsletter returns only the eMailing- or Leadpage object with the current article. If you want to output the entire e-mailing or lead page object with all the articles it contains instead, you must also use getFullNewsletter.
Syntax
THIS/getNewsletter
Return value
Use
<div tal:content="THIS/getNewsletter/getInputFields/0"> </div> <div tal:content=
"THIS/getNewsletter/getFullNewsletter/getSlots/0/0/getName"> </div>
<div>value from input field 0</div> <div>name
of the first article in the first slot</div>
See also:
getSlotId
getSlotId returns the ID of the slot in which the article is located. This function can also be applied directly to an article reference.
Syntax
THIS/getSlotId
Return value
Use
<div tal:content="THIS/getSlotId"> </div>
<div>0</div>
See also:
isEven
isEven indicates whether the position of the current article within the slot is divisible by 2. This function can also be applied directly to an article reference.
Syntax
THIS/isEven
Return value
Boolean
Use
<div>straight position/div>
<div>Odd position/div>
See also:
isOdd
isOdd indicates whether the position of the current article within the slot is not divisible by 2. This function can also be applied directly to an article reference.
Syntax
THIS/isOdd
Return value
Boolean
Use
<div>Odd position/div>
<div>straight position/div>
See also:
isFirst
isFirst indicates whether the current article is the first in the slot or not. isFirst can also be applied directly to an article reference.
Syntax
THIS/isFirst
Return value
Boolean
Use
<div>the first article
<div>not the first article
See also:
isLast
isLast indicates whether the current article is the first in the slot or not. isLast can also be applied directly to an article reference.
Syntax
THIS/isLoad
Return value
Boolean
Use
<div>the last article
<div>not the last article
See also:
getOddEvenCSSClass
getOddEvenCSSClass returns the CSS class of the current article for the even or odd position in the current slot. This function can also be applied directly to an article reference.
Syntax
THIS/getOddEvenCSSClass
Return value
"odd" or "even"
Use
<div tal:attributes="class THIS/getOddEvenCSSClass"> </div>
<div class="even"> </div>
See also:
getPosCSSClass
getPosCSSClass returns the CSS class of the current article for the first or last position in the current slot. this function can also be applied directly to an article reference.
Syntax
THIS/getPosCSSClass
Return value
"first" or "last"
Use
<div tal:attributes="class THIS/getPosCSSClass"> </div>
<div class="first"> </div>
See also:
getSortPos
getSortPos returns the position of the current article within the slot, starting with 0. This function can also be applied directly to an article reference.
Syntax
THIS/getSortPos
Return value
Use
<div tal:content="THIS/getSortPos"> </div>
<div>0</div>
See also:
getSortPosPlusOne
getSortPosPlusOne returns the position of the current article within the slot, starting with 1. This function can also be applied directly to an article reference.
Syntax
THIS/getSortPosPlusOne
Return value
Use
<div tal:content="THIS/getSortPosPlusOne"> </div>
<div>1/div>
See also:
isAnyHTMLMode
isAnyHTMLMode specifies whether the current article 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
isAppendMode indicates whether the current article 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:
isEmailMode
isEmailMode indicates whether the current article 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
isFacebookMode indicates whether the current article 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
isLPMode specifies whether the current article 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:
isPdfMode
isPdfMode indicates whether the current article is currently displayed as PDF.
Syntax
THIS/isPdfMode
Return value
Boolean
Use
<div>Display as PDF</div>
<div>Display not as PDF</div>
See also:
isSocialMode
isSocialMode indicates whether the current article 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
isTextMode indicates whether the current article is displayed in a text-only email.
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
isWebMode specifies whether the current article is displayed in a browser.
Syntax
THIS/isWebMode
Return value
Boolean
Use
<div>display in browser/div>
<div>Display not in browser</div>