Share » Forums » Setup & design » Section Id and Node Id

Section Id and Node Id

Section Id and Node Id

Wednesday 30 April 2003 2:43:54 pm - 2 replies

Author Message

jonathan howes

Wednesday 30 April 2003 3:46:38 pm

I have been looking into this further and it appears I answered my own question (forgive me for being a Newbie - my actual profession is as an accountant)

This is what I have come up with ( parent_node_id,2 is my root folder of the enire site - I then have 11 different sections and each folder in the root is assigned to a different section)

IE,
Root
Folder1 (section1)
- Sub pages and folders
Folder2 (section2)
- Sub pages and folders
.
.
Folder11 (Section11)
-Sub pages and folders

I used to need 11 templates (one for each section) that all share common script except for references relating to images, and menu bars etc. I can now have 1 main template for all 11 and use variables throughout based on the uniques section id's. A specific example is the top_cat variable in the nav tree menu .

{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)}
{$Child:item.node_id}
{/section}
{/section}
{/let}

I am stuck on how to this variable {Child:itm.node_id} to the variable top_cat that is used in the nav tree menu?? I have tried set and top_cat= but it does not seem to work -

If you have any suggestions please let me know

I seem to be having difficulty understanding the way you pass variables.

I am going to move on for now to sort out how to loop through the nav tree menu based on a count of how deep the folder structure is - rather than having to pre-define all the levels manually. This will include a way to show the active items with varying css applied based on that depth.

On another note I have modified the the sitemap to always show the node_id to make things easier to understand - this is a simple mod I can post for any new people if they want - it helps understand the site structure.

jonathan

Gunnstein Lye

Friday 02 May 2003 6:55:24 am

I'm not entirely sure I understand what you want to do, but here is my suggestion:

{let children=fetch('content','list',hash(parent_node_id,2))
top_cat=false()}

{section name=Child loop=$children}
{section show=eq $:item.object.section_id,$DesignKeys:used.section)}
{set top_cat=$:item.node_id}
{/section}
{/section}

{* Now you can use $top_cat (within the let pair). *}
top_cat is: {$top_cat}

{/let}

The {set} function requires that you have created the variable with {let} or {default} in advance.

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

36 542 Users on board!

Forums menu