I am using the EpiServer:PageTree control to generate a nested <ul><li> list in the format below.
However I am also using a dropdown menu system called UDM which requires that the class and id "udm" are on the first <ul> tag.
The EpiServer:PageTree IndentTemplate in the user control markup is used to generate the nested <ul> tags in each <li>.However the IndentTemplate means that the <ul> tag is always the same at all levels and doesn't allow me to have <ul id="udm" class="udm"> just for the first <ul>
I have tried to acheive this in the code behind but haven't been able to find the correct methods to use.
<ul id="udm" class="udm"> <li><a href="/">Home</a></li> <li><a href="/about/">About</a> <ul> <li><a href="/about/item1/">Item 1</a></li> <li><a href="/about/item2/">Item 2</a></li> </ul> </li> <li><a href="/contact/">Contact</a></li></ul>
Hope someone can point me in the right direction.
I wrote a little blog post explaining how you can add the correct CSS class (and id if you need). Adding different CSS classes when using the EPiServer PageTree.
Hope this helps.
Thank you very much for your blog post. It has worked perfectly.
The Container.Indent value in the IndentTemplate is very useful.