Adding a container element

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

There are different types of containers:
  • Normal Container: Defined in any template element except tables, rows, and lists.
  • List Container: Defined in a list at the same level as list details.
  • Table Container: Defined in a table at the same level as rows.
  • Row Container: Defined in a row at the same level as cells.
When using 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 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 on 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.

The following are list of tasks that can be performed in the container element and also some restrictions of tasks that cannot be performed:
You can:
  • Drag normal containers in any other normal container 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.
  • Drag list containers in any other list containers or lists. For example, you can define a container inside a list and then drag it in another list container in the same list or (another list) or you can define a container inside a list and then drag it in another list.
  • Drag table containers in any other table containers or table. For example, you can define a container inside a table and then drag it in another table container (in the same table or another table) or you can define a container inside a table and then drag it in another table.
  • Drag row containers in any other row containers. For example, you can define a container inside a row and then drag it in another row container in the same row or another row.
  • Drag normal container in list containers, table containers, or row containers as long as the normal container includes only elements allowed in the list container, table container, or row container. The valid included elements are other containers and dynamic data sources. For example,
    1. Define a container at the root of the template.
    2. Add a DDS block inside it or another container.
    You can drag them in any list container, table container, row container, or list, table, row.
You cannot:
  • Drag list containers, table containers, row containers in any other element other than list containers, table containers, row containers or in lists, tables, rows. For example, you cannot drag a table container outside the table regardless of its contents.
  • Drag normal containers in list containers, row containers, table containers or in lists, rows, tables if they contain any element that is not allowed in the target context.
  • A container including other containers cannot be dragged from outside a table, row, list into a table, row, list.

Procedure

  1. Add a container element to the template content editor by one of the following methods:
    • From the Palette view, drag a Container icon Container element into the template content editor.
    • In the editor area, right-click and select Insert > Container icon Container.
    • In the Outline pane, right-click Content and select Insert > Container icon Container.
  2. Select the container element.
  3. In the Properties, modify the properties of the container.
  4. Click File > Save As 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 executed repeatedly. You can set the do while property of the container to true and the container, and all of its children, are evaluated again.

Feedback