A container element is different from a paragraph. Unlike
paragraphs, containers have no footprint in the output document. So
you can define conditions, perform calculations, or identify data
on a group of elements without affecting the formatting of the output.
About this task
- You can perform the following tasks with containers:
- Drag a container element into any of the following elements:
- Containers
- Lists
- List details
- Paragraphs
- Iterations
- Tables
- Rows
- Cells
- Drag a container into another container when that container includes
only elements that are allowed in a container. For example, you can
drag a container into another container that is in a row element.
However, if the container has a paragraph element in it, it cannot
be dragged into another container that is in a row element because
rows cannot contain paragraphs.
- Drag a container into another container that is limited by queries.
For example, you can drag a container in another container at the
root of the template or drag a container in a container inside a paragraph.
- You cannot perform the following tasks with containers:
- Drag containers into elements other than containers, lists, list
details, paragraphs, iterations, tables, rows, or cells. For example,
you cannot drag a container into a text element.
- Drag a container included in a table, row, or cell element outside
of that element type. For example, if a row has a container element
in it, the container element cannot be moved to a different row in
the table. In general, do not drag a container included in an element
outside of that element type.
- Set the once per table property to true for
a row element when the row is inside of a container element.
- Iterating on containers
- When you use an iterator, you can use it within the container.
An iterator helps to change the formatting element easily and also
makes the template more uniform. For tables, the advantage is that
you can avoid seeing empty rows in the output when you put a condition
in the row that is based on the attributes of the parent container.
You can also avoid seeing rows with uneven number of cells.
- When tables are being used, you can put the query in containers
that host rows or in containers inside cells, depending on where you
must iterate. When you are not using tables, you can put all queries
on containers and then inside those containers, you can put the rendering
elements, such as paragraphs, hyperlinks, and text.
Important: After you add a container to
a table, row, or cell element, you cannot move that query outside
of the table element. Containers are handled differently inside tables
and that context does not apply outside of a table element. Use new
container elements when necessary.
Procedure
- Add a container element to the template content editor
by one of the following methods:
- From the Palette view, drag a
Container element
into the template content editor.
- In the editor area, right-click and select .
- In the Outline view, right-click Content and
select .
- Select the container element.
- In the Properties view, modify the
properties of the container.
- Click or click the Save icon.
What to do next
Note: A Loop function adds the do
while loop capabilities to IBM® Rational® Publishing Engine,
which enables actions to be run repeatedly. You can set the do
while property of the container to true so
that the container and all of its children are evaluated again.