3214 Posts in 848 Topics by 810 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1297 Views |
-
Coding: How to Embed Menu Items?

21 March 2009 at 1:41am
Hi,
This should be possible to do:
<ul>
<li> Item one </li>
<ul>
<li> Sub-Item One <li>
<ul>
<li> Sub-Sub-Item One </li>
</ul>
</ul>
<li> Item two </li>
</ul>Please can anyone look and make suggestions on what I've already worked on:
<% if Menu(1) %>
<ul>
<% control Menu(1) %>
<li>
<a href="$Link" title="Go to the $Title page" class="$LinkingMode">$MenuTitle
<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<% if Menu(2) %>
<ul>
<% control Menu(2) %>
<li>
<a href="$Link" title="Go to the $Title page" class="$LinkingMode">$MenuTitle
<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<% if Menu(3) %>
<ul>
<% control Menu(3) %>
<li>
<a class="drop" href="$Link" title="Go to the $Title page">$MenuTitle
<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
</li>
<% end_control %>
</ul>
<% end_if %>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>
<% end_control %>
</ul>
<% end_if %>
</a>
</li>
<% end_control %>
</ul>
<% end_if %>It's for a CSS-only Dropdown Menu to level 3.
Thanks
David -
Re: Coding: How to Embed Menu Items?

21 March 2009 at 2:15am
Bit of a nasty hack , but this page should help you :
http://doc.silverstripe.com/doku.php?id=tutorial:site-map&s=sitemap
-
Re: Coding: How to Embed Menu Items?

21 March 2009 at 3:25am
Thanks! This worked:
<div class="menu">
<ul>
<% control Menu(1) %>
<li>
<a href="$Link" title="Go to the $Title page" class="$LinkingMode">$Title<!--[if IE 7]><!--></a><!--<![endif]-->
<% if Children %>
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul>
<% control Children %>
<li>
<a href="$Link" title="Go to the $Title page" class="drop">$Title<!--[if IE 7]><!--></a><!--<![endif]-->
<% if Children %>
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul>
<% control Children %>
<li>
<a href="$Link" title="Go to the $Title page" class="left">$Title
</li>
<% end_control %>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
<% end_if %>
</li>
<% end_control %>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
<% end_if %>
</li>
<% end_control %>
</ul>
</div>
| 1297 Views | ||
|
Page:
1
|
Go to Top |


