What did I do wrong here??? Can't describe the problem...

Author Message

Aya Brea

Friday 28 May 2004 9:36:29 am

{default sublist=10 list=array()}
{set list=fetch('content',
				'list',
				hash('parent_node_id', 2)
				)}
{section name=bit loop=$list}
{set sublist=fetch(	'content',
					'list_count',
					hash('parent_node_id', 2)
					)}
{$sublist}{* <b><--- Problem here</b>  *}
{/section}
{/default}

The $sublist variable always output default value, maybe the fetch function didn't work, maybe I have accessed wrong variable... someone please help...

Paul Borgermans

Friday 28 May 2004 1:18:32 pm

Hi

You can not use set to change variables outside the current namespace, but set-block can, see:

http://ez.no/ez_publish/documentation/reference/template_functions/variables/set_block

Although i do not see the purpose of your code sample, this should do what you want:

{default sublist=10 list=array()}
{set list=fetch('content',
				'list',
				hash('parent_node_id', 2)
				)}
{section name=bit loop=$list}
{set-block scope=root variable=sublist}
{fetch(	'content',
					'list_count',
					hash('parent_node_id', 2)
					)}
{/set-block}
{$sublist}{* <b><--- no problem here anymore i think </b>  *}
{/section}
{/default}

Have a nice weekend

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Aya Brea

Friday 28 May 2004 9:03:17 pm

This work :D

Thanks a lot Paul...

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 31 2025 04:27:16
Script start
Timing: Jan 31 2025 04:27:16
Module start 'layout'
Timing: Jan 31 2025 04:27:16
Module start 'content'
Timing: Jan 31 2025 04:27:16
Module end 'content'
Timing: Jan 31 2025 04:27:16
Script end

Main resources:

Total runtime0.0141 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.3750151.2422
Module start 'layout' 0.00560.0025 739.617236.6953
Module start 'content' 0.00810.0046 776.312590.2344
Module end 'content' 0.01270.0014 866.546933.9922
Script end 0.0141  900.5391 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002416.7053140.0002
Check MTime0.00128.4000140.0001
Mysql Total
Database connection0.00128.220710.0012
Mysqli_queries0.002416.811830.0008
Looping result0.00000.164010.0000
Template Total0.00117.610.0011
Template load0.00096.299610.0009
Template processing0.00021.297110.0002
Override
Cache load0.00064.561110.0006
General
dbfile0.00107.003180.0001
String conversion0.00000.071040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs