Simple.tpl is not working need help

Author Message

sangib das

Thursday 31 August 2006 8:42:18 pm

Hi
i have the following code
{def $offset=0

$limit=8}

{if is_set($view_parameters.offset)}

{set $offset=$view_parameters.offset}

{/if}

{def $meny=fetch('content','list',

hash( 'parent_node_id', $node.node_id,

'offset', $offset,

'limit', $limit ))}

{def $meny_count=fetch('content','list_count',

hash( 'parent_node_id', $node.node_id ))}

<table>
{foreach $meny as $element}


<tr>
{if eq($node.node_id,$:element.node_id)}
<td width=15> <img src={"images/red_sarrow.gif"|ezdesign} ></td><td>
<a href={$:element.url_alias|ezurl} class=innerlinks> <b>{$:element.name}</b></a>
</td>
{else}
<td width=15> </td><td>
<a href={$:element.url_alias|ezurl} class=innerlinks> {$:element.name}</a>

{/if}

</td>
</tr>
{/foreach}

</table>
{include uri="design:navigator/simple.tpl"

page_uri=$node.url_alias

item_count=$meny_count

view_parameters=$view_parameters

item_limit=$limit}

<span class="content_text">
</span>

is not woking pls help me
Thanks

Claudia Kosny

Saturday 02 September 2006 3:43:57 am

Hello sangib das

There is at least one error in your code: If you use an foreach statement to loop through an array, you do not use a : to refer to the item within the loop.
So instead of $:element you just use $element within the foreach loop.

You also have an error in your html code, the last </td> must come before the closing {/if}

BTW: If you post code here please try to format it a bit better, especially try to remove the empty lines in between as they make it hard to read. Also try to give us more information about what is not working, a simple 'it is not working' is seldom helpful. You can often get additional information about problems by looking at the debug output and even the fact that you do not get any debug errors might be useful to us.

Greetings from Luxembourg

Claudia

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.