Please help assigning value to a variable - not working properly

Please help assigning value to a variable - not working properly

Thursday 01 May 2003 2:49:22 pm - 2 replies

Author Message

Vivienne van Velzen

Friday 02 May 2003 2:52:20 am

Jonathan,

Can't really explain why, but the problem lies with the fact that you name the second {let}. I changed your code to the following, and that works.

{let top_cat=24
used_node=false()
menu_css=5
menu_css_active=6}
!{$top_cat}!
{let children=fetch('content','list',hash(parent_node_id,2))}
{section loop=$:children}
{section show=eq($:item.object.section_id,$DesignKeys:used.section)}
{set top_cat=$:item.node_id}
[ {$:item.node_id} ]
= {$top_cat} =
{/section}
{/section}
{/let}
{* Set your top category here *}
*{$top_cat}*
{/let}

As you can see, I removed the name 'Child' from the second {let} and the loop items (you could even remove the whole second let and place the fetch in the section, i.e. loop=fetch(...)).
Anyway, as said, the above works for me. Now I'm gonna look a bit closer at namespaces.....
Greetz,

Vivienne

jonathan howes

Friday 02 May 2003 4:34:56 am

Thanks for the help - I had about 10 different verions of the same coded - all with minor differences - all returned the same problem in terms of not setting the value.

Thanks for the info on the {section=name loop=fetch()} I have use it before but I felt my above example was the clearest in terms of "full" code with no short cuts.

Maybe someone at ez publish or one of the other members of this forum can explain the problem in my original code and post some more info about the namespaces.

Jonathan

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

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