This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Setup & design » Trouble with using names in nested...
expandshrink

Trouble with using names in nested sections

Trouble with using names in nested sections

Monday 07 July 2003 9:46:03 pm - 3 replies

Hello, I'm having trouble calling data from one section in another section... Is this possible?

{section name=One loop=fetch(content,tree,hash(parent_node_id,$node.node_id,class_filter_type,include,class_filter_array,array(1)))}
{section name=Two loop=5}
{$One:node.name}
{/section}
{/section}

Any ideas?

Tuesday 08 July 2003 12:24:32 am

Try

{section name=One loop=fetch(content,tree,hash(parent_node_id,$node.node_id,class_filter_type,include,class_filter_array,array(1)))}
{section name=Two loop=5}
{$One:item.name} <-- This line
{/section}
{/section}

Cheers
Bruce
designIT

Tuesday 08 July 2003 7:04:24 am

That is the way that I've done it. Sorry, I did a poor job putting together my example. I've probably had more trouble with section names then anything else in eZ publish.. Sometimes I name a section and my application won't work, but if I remove the name it works! Is there a trick to using section names? Are the names variables that have to be initialized first using let or default?

Wednesday 09 July 2003 1:11:53 am

Hi Lance

The name parameter on sections is used to set a variable scope. Using sections to loop sets the variables $item, $index and $key in the current scope.

If you try to do what you you are doing with out the names then the outter section loop $item, $index and $key variables with be over written by the inner section loop variables.

If you are still haveing trouble with the template code turn on debugging. I'm sure the answers will be there happy.gif Emoticon

Cheers
Bruce
designIT

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from