Monday, July 23, 2012

How to create a sitemap/navigation for website in Umbraco with XSLT?

Working on a project, made in Umbraco CMS, I got to the point where I had to generate a navigation in footer. Just something like this






This is content Tree. Not all pages from footer image above appear in sitemap structure. I put the image just for you to realize what I had to do and what you might also want to achieve.

Now: according to my content, I wanted a list like this:

  •  About Patient Direct with childs bellow
  1.  Program Coverage (this page as you can see in image above has Hide in navigation = yes, so for me means they are childs of About....) 
  2.  Eligibility 
  •  Network 
  1.  About the Patient...
  2.  Dentist Search 
  •  Enroll Now 
  •  Wellness
Pretty nice, hm?
Good so how do you generate such a menu using Xslt?
Here is code I did and helped me.

< ? xml version="1.0" encoding="UTF-8" ? >
< ! DOCTYPE 
xsl:stylesheet [
    < ! ENTITY nbsp " ">
] >



    
    
    
    
    
        
            
        
    

    
        
        
        

            
                

        

    

    
        
        
  • bottom_border
  • bottom_border
If you need explanations about code please write it as a comment ;)

No comments:

Post a Comment