3214 Posts in 848 Topics by 810 members
| Go to End | Next > | |
| Author | Topic: | 3437 Views |
-
Tree Menu

23 January 2009 at 10:33pm
Hi,
is there an easy way to build a tree menu like this :
<ul>
<li><a href="">Section 1</a>
<ul>
<li><a href="">Section 1.1</a></li>
<li><a href="">Section 1.2</a></li>
</ul>
</li>
<li><a href="">Section 2</a></li>
............
</ul>from site tree content
-
Re: Tree Menu

24 January 2009 at 3:17pm
yes this can be done,
use the following code
<ul>
<% control Menu(1) %><li><a href="$Link">$MenuTitle</a></li>
<% if Menu(2) %>
<ul>
<% control Menu(2) %><li><a href="$Link">$MenuTitle</a></li>
<% if Children %>
<ul>
<% control Children %><li><a href="$Link">$MenuTitle</a></li>
<% end_control %>
<ul>
<% end_if %><% end_control %>
</ul>
<% end_if %>
<% end_control %>
</ul> -
Re: Tree Menu

24 January 2009 at 10:23pm
Thanks, here is my working script :
<ul id ="navigation">
<% control Menu(1) %>
<li class="$LinkingMode navigation_$iteratorPos"><a href="$Link" title="$Title.XML page" class="$LinkingMode">$MenuTitle.XML</a>
<% if Children %>
<ul>
<% control Children %>
<li><a href="$Link">$MenuTitle</a></li>
<% end_control %>
</ul>
<% end_if %>
</li>
<% end_control %>
</ul> -
Re: Tree Menu

25 January 2009 at 1:55am
Good, I see your code only have two levels but mine has three levels ;)
-
Re: Tree Menu

25 January 2009 at 1:59am
Yes
I think there's no way to build a recursive tree with .ss, isn't it?
while($children){....
-
Re: Tree Menu

10 September 2009 at 9:35am
Hi,
I am trying to do the same and to use ddsmoothmenu.
I would like to go as deep as the tree is.
But it seems to be impossible to call a template recursively, isn't it ?Menu.ss
<ul>
<% control Menu(1) %>
<li>
<a href="$Link">$MenuTitle</a>
<% include _Menu %>
</li>
<% end_control %>
</ul>_Menu.ss
<% if Children %>
<ul>
<% control Children %>
<li>
<a href="$Link">$MenuTitle</a>
<% include _Menu %>
</li>
<% end_control %>
</ul>
<% end_if %><% include _Menu %> in _Menu.ss does not work.
And what if IK would like to pass an argument like the level ?
<% include _Menu(level++) %>Thanks
-
Re: Tree Menu

17 October 2009 at 8:36pm
I have released a simple module - ssdropdownmenu - to do that
| 3437 Views | ||
| Go to Top | Next > |


