Hi, I am trying to build a multi-level dropdrown menu using Razor, There are loads of example for XSLT out there but I cant find a relevant example for using dropdown menus using Razor..
What I am looking for is something like which works perfectly in html
The Above razor syntax works fine for AncestorOrSelf(1) which is Top level , but i need sub nodes for products which is AncestorOrSelf(2), Does any one knows how to acheive this
Mulit Level Drop down Menu using Razor in Umbraco
Hi, I am trying to build a multi-level dropdrown menu using Razor, There are loads of example for XSLT out there but I cant find a relevant example for using dropdown menus using Razor..
What I am looking for is something like which works perfectly in html
<ul class="myMenu">
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Products</a>
<ul>
<li><a href="#">Products1</a></li>
<li><a href="#">Products2</a></li>
<li><a href="#">Products3</a></li>
</ul>
</li>
<li><a href="#">ContactUs</a></li>
</ul>
</div><!--TopMenu-->
The Above razor syntax works fine for AncestorOrSelf(1) which is Top level , but i need sub nodes for products which is AncestorOrSelf(2), Does any one knows how to acheive this
Thanx
I think what you really want is the sub-nodes of each of your top-level nodes. So something like this should work:
This code does work for getting child nodes, but it does not highlight the current page for children that you are viewing.
I have tried some recursive syntax, but it seems to be too complex. usually giving me errors with non-declaritive value.
possibly a parameter that I am missing, but i cannot seem to find out where.
Does anyone have any suggestions with the current code that is part of this thread?
marmar you should be able to use this :
It works fine, thanks for the tutorial!
is working on a reply...