First you need to know the depth of the main parent node, then use $node.path_array to find that node ID. e.g. if the main parent node depth is 1 then use $node.path_array.1, this will return the node ID for the main parent.
Use {$node.path_array|attribute(show)} from one of your document nodes and you'll see something like this:
Attribute Type Value
0 integer 1
1 integer 2
2 integer 85
3 integer 80
4 integer 90
This is a fairly common practice for tree menus, sometimes you might have to use $module_result.path.1.node_id instead, this will depend on the context you are in, you might be in the pagelayout.tpl for example. The method you are using can also work but to get the main parent you need to go up another level, i.e. $contentStructureTree.parent.parent.node_id but I'd suggest you use the path_array method because it doesn't have to fetch as many objects to get the same result.
Nathan, thank you so much! Your explanation has really helped me having a much clearer vision of the things now.
From the simplified_treemenu/show_simplified_treemenu.tpl template, though having some trouble getting something out using path_array and since path_string seems to return instead the parent node I was looking for, I made it work this way..
Because I don't have an install running that uses the simplified tree menu template I can't quickly test this, if you can't access the path_array you should try dumping the variables with: {$contentStructureTree.parent_node.node|attribute(show)}
This will show you all of the available information of the node. If ever in doubt you should try dumping variables this way, it's usually the quickest way to find what you need.
Cheers Nathan.
Pardon me while I burst into flames...
You must be logged in to post messages in this topic!