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.

eZ debug

Timing: Jan 18 2025 21:00:29
Script start
Timing: Jan 18 2025 21:00:29
Module start 'layout'
Timing: Jan 18 2025 21:00:29
Module start 'content'
Timing: Jan 18 2025 21:00:29
Module end 'content'
Timing: Jan 18 2025 21:00:29
Script end

Main resources:

Total runtime0.5822 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 589.0469152.6250
Module start 'layout' 0.00510.0025 741.671939.4609
Module start 'content' 0.00770.5731 781.1328469.8047
Module end 'content' 0.58080.0014 1,250.93758.1563
Script end 0.5821  1,259.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.5143160.0002
Check MTime0.00130.2152160.0001
Mysql Total
Database connection0.00080.128810.0008
Mysqli_queries0.533191.5706540.0099
Looping result0.00050.0796520.0000
Template Total0.558695.920.2793
Template load0.00180.303720.0009
Template processing0.556895.636020.2784
Template load and register function0.00010.023710.0001
states
state_id_array0.00030.045310.0003
state_identifier_array0.00060.105320.0003
Override
Cache load0.00150.2515490.0000
Sytem overhead
Fetch class attribute can translate value0.00060.107220.0003
Fetch class attribute name0.00100.172520.0005
XML
Image XML parsing0.00030.046120.0001
class_abstraction
Instantiating content class attribute0.00000.001020.0000
General
dbfile0.00060.0984100.0001
String conversion0.00000.001640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs