The objects that make up a communication can be inserted repeatedly.
Think, for example, of the structure of an article that can be replicated to add new informational blocks. These blocks are called Containers and can be declared with the attribute mn:container
.
<div mn:container mn:repeatable> <h1 mn:editable>Title</h1> <div mn:editable>Text</div> </div>
This code will add a button to the designer to insert an object that can then be moved or deleted.
Container attributes
Attribute | Description | Example |
---|---|---|
mn:repeatable | The content of the container can be inserted multiple times. | |
mn:min | Minimum number of objects that can be inserted into the container. | mn:min="1" |
mn:max | Maximum number of objects that can be inserted into the container. | mn:max="infinite" |
mn:type | Defines a list of content types to populate the container if it is empty when the template is applied. | mn:type="type1" |
mn:default | Defines the default objects for the container. | mn:default="type2" |
mn:feed | Enables the insertion of content from an RSS Feed or other custom content sources. | |
mn:feedurl |
Used in association with mn:feed . The specified URL will be shown as default.
|
mn:feedurl='http:// |
<div mn:container mn:repeatable mn:min="2" mn:max="4">
<div mn:editable>This content could be repeatable from 2 to 4 times</div>
</div>
Note:
A
A
mn:feed
type object is applicable only if a compatible type is also defined (for example, of article type).
<div mn:container mn:repeatable mn:type='article' mn:feed mn:feedurl='http://blog.magnews.it'></div>