Developer forum

Forum » Templates » Creating xslt template for top navigation

Creating xslt template for top navigation


Reply
The menu consists of all first level pages. But I need it to allso contain all second level subpages (if any) to the first level pages. The subpages I need to wrap in a nestet ul. I have tried for some time now, and I just cant get it right. What am I missing to make it work.
The solution Im working on is: www.intermail.dk/admin -> Lettershop Mailservice 2010.
The template Im working on is located in Templates -> Navigation and is called LIClean_new.xslt

A visible example of what Im trying to do is:
<ul>
  <li>Forside</li>
    <ul>
      <li>subpage 1</li>
      <li>subpage 2</li>
      <li>subpage 3</li>
    </ul>
  <li>Produkter</li>
    <ul>
      <li>subpage 1</li>
      <li>subpage 2</li>
      <li>subpage 3</li>
    </ul>
.....
</ul>

Replies

 
Nicolai Høeg Pedersen
Reply
Using the normal LIClean.xslt would do that with these settings:

 settings="startlevel:1;endlevel:2;expandmode:all;"

Start from level 1, end at level 2, include all nodes in that span...
 
Reply
Thanks for the quick reply.
 
Reply
Ok.. I have implementet the code and now its works on a subpage when it is selected, but the dropdown doesnt work on the frontpage. I can only see the first level pages on the frontpage navmenu. Im using the same settings on the frontpage as I am on the subpage. I have checked out the source code of the page: http://www.intermail.dk/Forside-2143.aspx?, and it does not have lists with subpages.. What could be wrong?
 
Nicolai Høeg Pedersen
Reply
Well - in your designs folder you should have a folder called Navigation for your navigation templates. You do not have that.

It the falls back to /Files/Templates/Navigation and the LIClean.xslt template you have in that folder is not recursive - meaning it does not expand your navigation beyond only one level.

Attached a zipfile called Navigation.zip. Unzip it so you have a folder called /Files/Templates/Designs/Navigation and place the content of the zip in that folder.

In there you'll find a working LIClean.xslt and a breadcrmb.xslt.

Happy coding...
 
Reply
ok thanks for the help. sooo... Can I have the attachments please :)
 
Nicolai Høeg Pedersen
Reply
Sorry!

Now attached to my original post... :)
 
Reply
sweet! Thanks a million :)

 

You must be logged in to post in the forum