Group

Templating System : Designer Guide : Tag Reference : Group

Summary

The group tag is used only within the body of a multiple tag to provide additional formatting control between subsets of a multirow data source. The tag takes a column name from the enclosing multiple tag as its only attribute. It repeats a template section as long as the value of the column does not change from row to row.

The group tag also sets two additional values in your multirow:

Usage

<table>

<multiple name="shirts">

  <!-- Start a new row if the style changes -->

  <tr>
    <td>
      @shirts.style@
    </td>
    <td>

  <!-- List colors for the same style in a single cell -->

  <group column="style">
    @shirts.color@

    <!-- @shirts.groupnum@ will be the number of the color within the style -->

    <if @shirts.groupnum_last_p@ false>, </if>
    <else>, or </if>

  </group>

  <!-- End the row if the style is going to change on the next row

    </td>
  </tr>

</multiple>

</table>

[Note: Carsten added this feature during the Berlin Hackaton 2004-02-14]

The delimiter attribute will add a string after each row except the last row in the group:

  <group delimiter=" | ">
  ...

This attribute will cause the rows within the group to appear to be sepparated by vertical bars. This is much more convenient than using the <groupnum_last_p> tags to check whether we are on the last row.

Notes