Forums / Developer / Matrix Display

Matrix Display

Author Message

Pankaj Malhotra

Friday 14 October 2005 2:53:59 am

Hi,

In one of my pages I am showing the content of the matrix, how could i check is there any content in the matrix or not.

{attribute_view_gui attribute=$node.object.data_map.properties}

The above is the code through which i am displaying the contents i would like to know how many rows does it contain, if it contain more than one row then it should display the content other wise not. Please guide

Thanks in advance,
Pankaj

Ɓukasz Serwatka

Sunday 16 October 2005 11:49:04 pm

Hi,

Use this code to display how many rows or columns have your matrix

{*number of rows*}
{$node.object.data_map.properties.content.rowCount}

{*number of columns*}
{$node.object.data_map.properties.content.columnCount}

You can use {if} or sections, depends which version of eZ publish you use.

{if eq( $node.object.data_map.properties.content.rowCount, '100' )}
    {*show if number of rows is 100*}
{/if}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Pankaj Malhotra

Tuesday 18 October 2005 3:43:45 am

Hi,

{*number of rows*}
{$node.object.data_map.properties.content.rowCount}

{*number of columns*}
{$node.object.data_map.properties.content.columnCount}

The above code gave me the static count which is being descibed in the admin panel. What I want to know, that how many rows contain the data, if its there then it shud display the content other wise not.

Please view the url given below

http://203.190.143.198/EZ/index.php//products/powdered_laundry_products/cleaners_no_3

In the above page there is a box termed as Physical Properties, for that I want to know if there is empty record in the matrix then it should not display that Properties Box.

Thanks in advance

Pankaj