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

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 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.

The following list includes the tasks that can be performed in the container element and also some restrictions:
You can:
  • 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 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 a container into a list. For example, you can define a container inside a list and then drag it into another container in the same list or another list. You can also define a container inside a list and then drag it into another list.
  • Drag a containers into a table. For example, you can define a container inside a table and then drag it in another container in the same table or another table. You can also define a container inside a table and then drag it in another table.
  • Drag a container into a row. 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.
You cannot:
  • Drag containers into any other element other than containers, lists, tables, or rows. For example, you cannot drag a container into a text element.
  • Drag a container included in another element outside of that element. For example, if a row has a container element in it, the container element cannot be moved to a different row in the table.

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 view, right-click Content and select Insert > Container icon Container.
  2. Select the container element.
  3. In the Properties view, 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