Access to the container object
Container object
In a container, you access the current container object via SELF:
SELF
eMailing- or LeadPage template
In an eMailing-/LeadPage template you can reach the container via getContainer using the container ID.
THIS/getContainer/<id>
You can reach the special content container of an eMail or a LeadPage via getContentContainer:
THIS/getContentContainer
See also
Container functions
The container object provides a number of functions.
Note
If you want to use TAL in a container, the field must have the type "Code Macro".
hasAttributes
Specifies whether the attribute (field) with the specified name exists in the current container.
Syntax
<container>/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
Returns the attribute object of the container with the specified internal name.
Syntax
<container>/getAttributeByName/<name>
Parameters
name = internal name of the attribute
Return value
Use
<div tal:content="SELF/getAttributeByName/HEADLINE"> </div>
<div>heading 1/div>
See also:
getAttributesByType
Returns a list of the attributes of the current container that correspond to the specified type.
Syntax
<container>/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="#" tal:repeat="image SELF/getAttributesByType/TYPE_IMAGE" tal:attributes="src image"/>
<div>https://scnem.com/art_resource.php?sid=dsokp.2ag693n, https://scnem.com/art_resource.php?sid=dsokp.2ag693n, https://scnem.com/art_resource.php?sid=dsokp.2ag693n, https://scnem.com/art_resource.php?sid=dsokp.2ag693n, https://scnem.com/art_resource.php?sid=dsokp.2ag693n, https://scnem.com/art_resource.php?sid=dsokp.2ag693n</div>
See also:
getMandatorId
Returns the client ID.
Syntax
<container>/getMandatorId
Return value
Use
<div tal:content="SELF/getMandatorId"> </div>
<div>13683/div>