Nested ul li list using PageTree with class and id on first ul


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>
<li><a href="/about/item1/">Item 1</a></li>
<li><a href="/about/item2/">Item 2</a></li>
<li><a href="/contact/">Contact</a></li>

Hope someone can point me in the right direction.


David Green


Feb 27, 2010 20:04

Hi David

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.


Feb 28, 2010 0:28

Hi Frederik

Thank you very much for your blog post. It has worked perfectly.

The Container.Indent value in the IndentTemplate is very useful.


David Green

Feb 28, 2010 18:32
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.