Sunday 16 October 2005 2:33:21 pm
I'm using a fetch of the attributes of a class to be able to use the attribute names as column headers of a table. The trick bit is i'd like to be able to set the attributes that are printed and therefore the columns that are created. With an if eq statement I can get a match on one attribute identifier (see below), but i'd like to be able to test against the array of desired attributes/columns. I tried to use the or operator (see commented out line) but i'm not sure exactly how it works. Any suggestions?
{*gather attributes for a node object’s class and assign to $attributes variable*} {def $attributes=fetch( 'content', 'class_attribute_list', hash( 'class_id', $class.object.contentclass_id ) )}
{*start the table*} <table border="1">
{*create the headers row using each attribute name as a column header*}
<th>
<tr>
{foreach $attributes as $attribute}
{if eq( $attribute.identifier, 'organization_name')}
{*if or( $attribute.identifier [, organization_name' [, 'org_type']])*}
<td>
{$attribute.name|wash}
</td>
{/if}
{/foreach}
</tr> </th> Thanks! Fraser
|