Sergey D
|
Saturday 29 May 2004 3:18:33 pm
bug cooking tips:
- ez3.4.b2
- class with two three fields:
title - text line datatype,
lenghth - text line datatype, credits - matrix datatype two step direction:
I'm failed to substitute {attribute_view_gui...} by calling {let...} operator
step 1:
{section name=Classes loop=fetch( content, list, hash(parent_node_id, node.node_id))}
label_1: {$Classes:item.object.data_map.title.content}
label_2: {attribute_view_gui attribute=$Classes:item.object.data_map.length} <br>
label_3: {attribute_view_gui attribute=$Classes:item.object.data_map.credits}
{/section}
in my case attribute_view_gui calls
design/standard/templates/content/datatype/view/ezmatrix.tpl
result: everthing works great.
step 2:
now i'm doing cut and paste content of this template straight here inside let operator:
{section name=Classes loop=fetch( content, list, hash(parent_node_id, node.node_id))}
label_1: {$Classes:item.object.data_map.title.content}
label_2: {attribute_view_gui attribute=$Classes:item.object.data_map.length} <br>
label_3:
{let attribute=$Classes:item.object.data_map.credits}
===========================================================
{let matrix=$attribute.content}
<table>
<tr>
<th>
{section name=ColumnNames loop=$matrix.columns.sequential}
{$ColumnNames:item.name}
{delimiter}
</th>
<th>
{/delimiter}
{/section}
</th>
</tr>
<tr>
{section name=Rows loop=$matrix.rows.sequential}
<td>
{section name=Columns loop=$Rows:item.columns}
{$Rows:Columns:item|wash(xhtml)}
{delimiter}
</td>
<td>
{/delimiter}
{/section}
</td>
{delimiter}
</tr>
<tr>
{/delimiter}
{/section}
</tr>
</table>
{/let}
===========================================================
{/let}
{/section}
result: emty. label_3 is totaly empty.
my question: did I make something wrong?
Guys, I extremely need your help right now.
thanx, sergey d.
|
Vadym Savchuk
|
Tuesday 01 June 2004 2:16:06 am
Hello Sergey. For things to work you should just do the following substitutions in your tpl code:
$attribute -> $Classes:attribute
$matrix -> $Classes:matrix
$ColumnNames -> $Classes:ColumnNames
$Rows -> $Classes:Rows
or
$attribute -> $:attribute
$matrix -> $:matrix
$ColumnNames:item -> $:item
$Rows:item -> $:item
$Rows:Columns:item -> $:item
That is, you can either access your variables from <b>current namespace</b> ($:var) or with <b>full namespace path</b> ($Classes:Rows:Columns:var), because when you use section with 'name' parameter it creates its own namespace. Good luck!
|