When you’re building a web site in Site Studio you use the Site Studio functions to build the navigation, right?
Well, not always. It’s true that out of the box Site Studio comes with a number of features to build navigation based on the node hierarchy but you don’t have to do it that way. For a recent client we built the navigation features using a simple static list. This post explains how we did it and why.
To create our navigation contributors and site administrators, created a site structure in the usual way using Designer or Manager. Nodes were assigned Primary and Secondary templates as normal. The navigation, however, was contributed in a single region based on a static list. In this list the contributors were given different columns representing the navigation levels and they created links to page sections or secondary pages for each navigation element. We also provided additional options to control when and how links are displayed. With this method the entire navigation was built using a simple static list rather than basing it on the Site Studio node structure.
Now, you’re probably wondering why on earth we would do this given that Site Studio already provides some functionality in this area. Well there are a number of reasons which are shown below:
- Control over urls. Our client wanted to have control over the url for each page. In particular they wanted the urls to remain very short i.e. www.sitename.com/legal or www.sitename.com/latest-press-releases. These urls would have resulted in a very flat site hierarchy which makes little sense in the navigation. By separating the navigation from the hierarchy you get the best of both worlds.
- Secondary Pages. A static list navigation means that you can easily include secondary pages in the navigation and they can be located wherever you like.
- Labels. The navigation label can be easily changed without altering the page url. They can also be updated using Contributor rather than having to go into Site Studio Manager.
- Sitemap. The same static list can be used to generate a sitemap and options can be put in to change the order or include and exclude links from the sitemap as compared to the navigation.
While this method won’t be applicable to all websites it does present an alternative view compared to the standard Site Studio functionality. Interestingly this is also the approach followed by the new WebCenter Sites.