ContentType Fields Example

This example uses the format macro to render the datatable returned from the contenttype.fields viper as html table.

Smartsite SXML CopyCode image Copy Code
<se:format inputdata="{contenttype.fields(WP)}">
    <se:rowformat>
        <tr>
            <td>{this.field(Number)}</td>
            <td>{this.field(Name)}</td>
            <td>{this.field(PhysicalField)}</td>
            <td>{this.field(IsRequiredField)}</td>
        </tr>
    </se:rowformat>

    <se:captionformat match="first">
        <se:rowresult>
            <tr>
                <th>Nr</th>
                <th>Logical fieldname</th>
                <th>Physical fieldname</th>
                <th>Required</th>
            </tr>
        </se:rowresult>
    </se:captionformat>

    <se:resultformat><table>{char.crlf()}{this.result()}</table></se:resultformat>
</se:format>