Mailing
Methods
- `getDropAreas`: iterable (int, DropAreaAccessor) - Returns all DropAreas present in the mailing, indexed with the number of the respective DropArea
- `getModules`: DropAreaByNumberAccessor - Returns an object for direct access to a specific DropArea via number
- `getConfigurationModules`: ConfigurationModuleByIdAccessor - Returns an object for direct access to a specific configuration module via ID
DropAreaAccessor
Methods
- `getNewsletter`: Mailing - Returns the mailing
- `hasModules`: bool - Returns whether there are modules in the DropArea modules are present
- `getModuleCount`: int - Returns the number of modules in the DropArea
- `getNumber`: int - Returns the number of the DropArea
- `isSubDropArea`: bool - Returns whether this DropArea is a SubDropArea
- `getParentModule`: Module - Returns the module, in which this SubDropArea is located or 'null' if this is not a SubDropArea
Iterate over all modules of the DropArea
If you want to iterate over the modules of the DropArea, you can simply do this directly via the accessor. A `ModuleAccessor` is returned in each case. In this example, the IDs of all modules of all DropAreas are returned.
<div tal:repeat="dropArea THIS/getDropAreas">
<div tal:repeat="module dropArea">
<div tal:content="module/getId">module-id</div>
</div>
</div>
Access to DropArea modules via module ID
If you want to access one of the DropArea modules directly via ID, you can do this directly via the path. The return value is `null|ModuleAccessor`. In this example, the ID of the module with the id `module_id` is output. It is assumed that `dropArea` has already been obtained in another way.
<div tal:content="dropArea/module_id/getId">module-id</div>
DropAreaByNumberAccessor
DropAreaByNumberAccessor is used for direct access to a specific DropArea via number. It returns `null|DropAreaAccessor`.
Methods
- `getNewsletter`: Mailing - Returns the mailing
Access to DropArea via number
In this example, the number of the DropArea `0` is output.
<div tal:content="THIS/getModules/0/getNumber">droparea-nummer</div>
ModuleAccessor
ModuleAccessor provides access to the values and information of a module and its module type.
Methods
- `getNewsletter`: Mailing - Returns the mailing
- `getId`: string - Returns the ID of the module (composed from IDs of the module type and the module)
- `getRealId`: string - Returns the real ID of the module
- `hasSubDropAreas`: bool - True if Sub-DropAreas were defined
- `getWidgets`: ModuleWidgetAccessor - Returns an object for direct access to widgets of the module
- `render`: string - Renders the module and returns the source code
Iterate over all Sub-DropAreas of the module
If the module supports Sub-DropAreas, these can be called up iteratively. A `SubDropAreaAccessor` is returned in each case. In this example, the numbers of all Sub-DropAreas of the module with the ID `module_id` are returned.
<div tal:repeat="subDropArea THIS/getModules/0/module_id">
<div tal:content="subDropArea/getNumber">sub-droparea nummer</div>
</div>
Access to a sub-drop area via number
Enables direct access to a Sub-DropArea via a number. This returns `null|SubDropAreaAccessor`.
Methoden
- `getNewsletter`: Mailing: Returns the mailing
Direct access via number
In this example, the number of the sub-drop area `0` is output. It is assumed that `module` has already been obtained in another way.
<div tal:content="module/0/getNumber">sub-droparea nummer</div>
SubDropAreaAccessor
SubDropAreaAccessor enables access to modules of Sub-DropAreas.
Methods
- `getNewsletter`: Mailing: Returns the mailing
- `hasModules`: bool - Returns whether modules are present in the Sub-DropArea
- `getModuleCount`: int - Returns the number of modules in the Sub-DropArea
- `getNumber`: int - Returns the number of the Sub-DropArea
Iterate over all modules of the Sub-DropArea
If you want to iterate over the modules of the Sub-DropArea, this can be done directly via the accessor. A `ModuleAccessor` is returned in each case. In this example, the IDs of all modules of all Sub-DropAreas are output. It is assumed that `subDropArea` has already been obtained in another way.
<div tal:repeat="module subDropArea">
<div tal:content="module/getId">module-id</div>
</div>
Access to modules of the Sub-DropArea via module ID
If you want to access one of the modules of the Sub-DropArea directly via ID, you can do this directly via the path. The return value is `null|ModuleAccessor`. Return value: null|ModuleAccessor In this example, the ID of the module with the id `module_id` is output. It is assumed that `subDropArea` has already been obtained in another way.
<div tal:content="subDropArea/module_id/getId">module-id</div>
ModuleWidgetAccessor
ModuleWidgetAccessor provides access to individual widgets of a module
Access to widgets via widget name
If you want to access the widget directly via the name of a widget, you can do this directly via the path. The returned accessor depends on the widget type (see below). In this example, the text representation of the widget is output with the name `widget_name`. It is assumed that `module` has already been obtained in another way.
<div tal:content="module/getWidgets/widget_name">module-id</div>
Widget accessors
Color
Access to individual color values, permitted are `red`, `green`, `blue` and `alpha`.
<div tal:content="widget/green">Value for the color channel</div>
Output of the color value as CSS-RGBa value
<div tal:content="widget">CSS-RGBa value for the color channel</div>
Dict
Access to individual values of the dictionary (in this example, `key_name` was defined in the module). Returns `null|string`.
<div tal:content="widget/key_name">Value for the color channel</div>
Selections
Access to options and selected values of selection widgets.
Check whether a specific option has been selected
If you want to determine whether an option has been selected in the module, this is possible via `isSelected`. This example checks whether the key `selection_key` has been selected.
<div tal:condition="widget/isSelected/selection_key">selected</div>
Iterate over all options
If you want to iterate over the options of a selection, this can be done directly via the accessor. This returns `Dict{key: string, label: string, checked: boolean}`. In this example, all defined options of the `selection` widget are output. In the following examples, it is assumed that `module` has already been obtained in a different way.
<div tal:repeat="option module/getWidgets/selection">
<span tal:content="option/key">key</span>
<span tal:content="option/label">label</span>
<span tal:condition="option/checked">checked</span>
</div>
Links
Methods
- `getUri`: string - Returns the original url
- `getLink`: string - Provides a trackable url
Link-Listen
If you want to access a link in the list using the defined key, you can do so directly via the path. this is possible directly via the path. In this case, `null|Dict{label: string, key: string, uri: string, link: string}` is returned.
- `label`: Name of the link
- `key`: Internal key
- `link`: Trackable link
- `uri`: Original uri
In this example, the link is output with the key `link_key` of the link list `links`.
<div tal:define="link module/getWidget/links/link_key">
<a tal:attributes="href link/link" tal:content="link/label">link</a>
</div>
Iterate over all links
If you want to iterate over the link list, this can be done directly via the accessor. This returns `Dict{label: string, key: string, uri: string, link: string}` is returned.
- `label`: Name of the link
- `key`: Internal key
- `link`: Trackable link
- `uri`: Original uri
<div tal:repeat="link module/getWidgets/links">
<a tal:attributes="href link/link" tal:content="link/uri">link</a>
</div>
Article
Methods
- `getArticleId`: int - Returns the ID of the article
- `getArticle`: ContainerAccessor - Returns a `ContainerAccessor` (see TAL article access) or `null` if the article does not exist
Article lists
Iterate over all articles
If you want to iterate over the item list, this can be done directly via the accessor. A `ContainerAccessor` is returned in each case. In this example, all articles in the `article_list` widget are iterated over.
<div tal:repeat="article module/getWidgets/article_list">
<div tal:content="article/getAttributeByName/....">CONTENT</div>
</div>
Container
Methods
- `getContainerId`: int - Returns the ID of the container
- `getContainer`: ContainerAccessor - Returns a `ContainerAccessor` (see TAL container access) or `null` if the container does not exist
Container lists
Iterate over all containers
If you want to iterate over the container list, you can do this directly via the accessor. A `ContainerAccessor` is returned in each case. In this example, all containers of the `container_list` widget are iterated over.
<div tal:repeat="container module/getWidgets/container_list">
<div tal:content="container/getAttributeByName/....">CONTENT</div>
</div>
Image
Methods
- `getImageId`: int - Returns the ID of the image
- `getImage`: string - Returns the url of the image or null if the image does not exist
Image lists
Iterate over all images
If you want to iterate over the image list, you can simply do this directly via the accessor, returning the image url in each case. In this example, all images in the `image_list` widget are iterated over.
<div tal:repeat="image module/getWidgets/image_list">
<img src="src image" />
</div>