Forums / Developer / How to link eZMatrix to another ezMatrix ?

How to link eZMatrix to another ezMatrix ?

Author Message

Mark Gerrits

Friday 14 November 2003 6:34:10 am

Hi all,

I have a folder class named 'product_group' which has an ezmatrix attribute. This attribute contains the 'specifications' of the products it contains. For example, the matrix for the group 'Monitors' lists

ID - Value
80 - Resolution
81 - Refresh rate

The 'Product' class also contains an matrix attribute :

ID - Value
80 - 1024x768
81 - 100Hz

The current override template loops through the elements of the group-matrix with the following code :

{section name=row loop=$specs.rows.sequential}
<tr>
<td>
{$row:item.columns[0]}
</td>
<td>
{$row:item.columns[1]}
</td>
<td>
<! VALUE HERE !>
</td>
</tr>
{/section}

$specs is the ezmatrix attribute of the productgroup.
$values (not showed) contains the matrix of the product currently viewed.

How can I join these two matrix attributes on the ID's in the matrix ? I tough I could do something like

$values[$row:index].columns[1]

But this goes out of sync when the elements are not listed in the same order. Instead of [1] I would like to link them on the ID Column (80/81).

Can somebody tell me if this is possible ?

PS Maybe the matrix datatype is not the right choice for this kind of thing.. any suggestions are very welcome.