Share » Forums » Setup & design » List child objects in a table

List child objects in a table

List child objects in a table

Thursday 06 October 2005 1:42:48 am - 3 replies

Author Message

Roy Bøhmer

Thursday 06 October 2005 2:45:45 am

I think you have a bug in your if-statement. It forces eZ to only input one td-tag for each tr. Not sure what you need the $column for. Try:

{def $column=1}
<table class="class-butikker">
  {section var=child loop=$list_items sequence=array(bglight,bgdark)}
 <tr>
    {set $column=1}
    <td>
       {node_view_gui view=line content_node=$child}
    </td>
    
    {set $column=2}
    <td>
	{node_view_gui view=line content_node=$child}
    </td>
  </tr>
 {/section}
</table>

This will result in two identical columns.

Benjamin Selmer

Thursday 06 October 2005 3:27:23 am

Two identical columns is of no use.

This is how i wanted it to work:

if column variable equals 1:
-insert tr start tag
-insert td
-set column variable=2

if column variable equals 2:
-insert td
-insert tr end tag
-set column variable=1

This should result in a table with two columns, but eZ automatically closes the tr after the first td.

I guess i coluld get a table-like result by floating the div's with css. But that does not work properly with all browsers.

Roy Bøhmer

Thursday 06 October 2005 6:19:53 am

Sorry, I read it too quick.

I've never heard of ez automatic closing tags. Actually your code looks ok.

Are you sure templates/node/view/line.tpl (or an override) doesn't contain any <tr></tr>?

Thats all I can think of right now, but I admit I don't think that's the problem :-)
Could you post the relevant html-output?

Roy

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu