Softriva .com
|
Wednesday 21 February 2007 6:23:50 am
Dears, I noticed that the {delimiter} does not work in nested {foreach} is there a system limitations {def $gnode_id=$node.node_id}
{def $gMenus=fetch(content,list, hash('parent_node_id', 59,'sort_by',array( 'priority', true() ))) $gChildern=false()}
<table>
<tbody>
<tr>
{foreach $gMenus as $gMenu}
<td>
<table>
<thead>
<tr><th>{$gMenu.name|wash}</th></tr>
</thead>
<tbody>
<tr>
<td>
{set $gChildern=fetch(content,list, hash('parent_node_id', $gMenu.node_id,'sort_by',array( 'priority', true() )))}
<ul>
{foreach $gChildern as $child}
<li><a href={$child.url_alias|ezurl}>{$child.name|wash}</a></li>
{/foreach}
</ul>
</td>
</tr>
</tbody>
</table>
</td>
{delimiter modulo=2}
</tr>
<tr>
{/delimiter}
{/foreach}
</tr>
</tbody>
</table>
|
Claudia Kosny
|
Wednesday 21 February 2007 7:46:18 am
Hi OOzy
This would be easier if you would have posted an example of what you expected and what you actually received... Using delimiter in foreach works fine for me:
{def $array1 = array(1,2,3,4)
$array2 = array('a','b','c','d')}
{foreach $array1 as $value1}
<br />
{$value1} : <br />
{foreach $array2 as $value2}
{$value2}
{/foreach}
{delimiter modulo=2}
delim for array1
{/delimiter}
<br />
{/foreach}
produces
1 :
a b c d
2 :
a b c d
delim for array1
3 :
a b c d
4 :
a b c d
which is exactly what I would expect. Claudia
|
Softriva .com
|
Friday 23 February 2007 10:26:04 am
Now, this is crazy. It don't work any more. I have seen Claudia output. I have seen this on my site. 1 :
a b c d
2 :
a b c d
delim for array1
3 :
a b c d
4 :
a b c d
this is crazy
|
Claudia Kosny
|
Friday 23 February 2007 11:53:59 am
Hi there
I actually tried on eZ 3.8.3, 3.8.6 and 3.9, but all of them had template compiling set to disabled (as they are my local development installations). If I enable it, it does not work anymore, no matter the system. As I never have used the delimiter (apart from the testing for OOzy), I did not realise that this before. I assume this has been fixed in the versions Andre was mentioning, but I have not tried it. Claudia
|