Thursday 01 May 2003 2:49:22 pm
I am using the code below in a template. the purpose is to only display certain folders based on the partent folder at the root level. At the root level each parent folder is in a unique section. I am going out and getting all section and node values for the content of node_id=2 and comparing to the section id of the page that is currently displayed ( So if you are viewing a folder 4 levels deep (node_id=287 section_id=3) the script will return the node_id (node_id=234 and section_id =3) of the 1st level folder in that section at the content level node_id=2. Whilst viewing a page with a node_id=287 the script sets the variable top_cat =24 (default incase of a folder not assigned to a cestion or some other error) then goes out and returns the node_id of the root parent which is 234 (this value is correct and then should assign this value to top_cat. It then displays the current value of top_cat.
The out put I am getting is
!24!
[234]
=24= *24*
The output I expected is
!24!
[234]
=234= *234* the problem seems to be in the assignment of the {set top_cat=....} Can Anyone help me please - I have tried everything I can think of jonathan <tr>
<td class="menuitem">
{* Set your top category here *}
{let top_cat=24
used_node=false()
menu_css=5
menu_css_active=6}
!{$top_cat}!
{let name=Child children=fetch('content','list',hash(parent_node_id,2))}
{section loop=$:children}
{section show=eq($Child:item.object.section_id,$DesignKeys:used.section)}
{set top_cat=$Child:item.node_id}
[ {$Child:item.node_id} ]
= {$top_cat} =
{/section}
{/section}
{/let}
{* Set your top category here *}
*{$top_cat}*
{/let}
</td> </tr>
|