Try our conversational search powered by Generative AI!

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

Vote:
 

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.

http://www.udm4.com/manual/quickstart/#quickstart-qsetup

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.

Regards

David Green

 

#37261
Feb 27, 2010 20:04
Vote:
 

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.

Frederik

#37262
Feb 28, 2010 0:28
Vote:
 

Hi Frederik

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

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

Regards

David Green

#37264
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.