4W WebMerge Tag Reference

WM-Record

Syntax
[WM-Record]
... Html to be replicated for each record
[/WM-Record]


[WM-Record width=width cols=cols]
 ... Html to be replicated for each record

[/WM-Record]

Examples
<body>
<table border="0" width="400">
[WM-Record]
 <tr>
  <td>[WM-Field: Name]</td>
  <td>[WM-Field: City]</td>
  <td>[WM-Field: State]</td>
 </tr>
[/WM-Record]
</table>
</body>


<body>
[WM-Record cols=2 width=500]
[WM-ImagePath: ProductImage]
[/WM-Record]
</body>  

Description

This tag is used only in index templates.

The HTML between the [WM-Record] and [/WM-Record] tags will be replicated once for each record in your export file. The data within the WM-Record tags can contain WM-Field and other tags, so you can pretty much make any layout you want.

If your template used the first example shown above, the page WebMerge generates will look something like:

<body>
<table border="0" width="400">
<tr>
 <td>Richard Gaskin</td>
 <td>Los Angeles</td>
 <td>CA</td></tr>
<tr>
 <td>Joe Schmoe</td>
 <td>Faketown</td>
 <td>PA</td></tr>
<tr>
 <td>Jane Doe</td>
 <td>Anytown</td>
 <td>MO</td>
</tr>
</table>
</body>

Any tags in an index page that are outside of [WM-Record] and [/WM-Record] tags will be processed only once, using the data from the last record processed for that page.

You can include any number of WM-Record tag pairs in a template, allowing you to have discontiguous layouts if needed.

If you want your records displayed in a multi-column format you can specify the number of columns with the cols attribute. This will cause WebMerge to generate a table around your records with the number of columns you specify, with each cell being top-aligned.

When using the cols attribute you can also specify the total width of the table with the width attribute. This will create a table of a fixed width, with each cell width being of fixed equal size.

If your template used the second example above, your generated code would look something like this:

     <body>
     <table width="500">
     <tr>
      <td width="250" valign="top">
      <a href="products/product001.html">
       <img src="images/product001.jpg" border=0></a>
      </td>
      <td width="250" valign="top">
      <a href="products/product002.html">
       <img src="images/product002.jpg" border=0></a>
     </td>
     <tr>
      <td width="250" valign="top">
      <a href="products/product003.html">
       <img src="images/product003.jpg" border=0></a>
      </td>
      <td width="250" valign="top"> 
      <a href="products/product004.html">
       <img src="images/product004.jpg" border=0></a> 
      </td>
     </tr>
     </table> 
     </body>



Introduced in version 1.5.
Version 2.0 introduced the ability to have multiple WM-Record tags in a given index template.
Version 2.2 introduced the table-generation attributes.