Skip to main content

Posts

Showing posts from March, 2016

Managed metadata navigation and friendly URLs in Sharepoint 2013

How to get friendly URL of the current page in Sharepoint programmatically Friendly URLs is the new feature of Sharepoint 2013. It allows to show urls like  http://example.com/products/ instead of  http://example.com/products/pages/default.aspx  in browser address bar, which is shorter and more user friendly. For developers it adds several challenges. I wrote about several of them already in the following posts ( here ,  here  and  here ). In web development in general it is often needed to get URL of the current page. When you use structural navigation and regular URLs it is quite easy: 1: string url = HttpContext.Current.Request.Uri.OriginalString; But how to get friendly URL of the current page when managed metadata navigation is used? The answer is TaxonomyNavigationContext  class. It contains several properties which will help you to work with friendly URLs programmatically, e.g.  HasFriendlyUrl  and  ResolvedDisplayUrl  (all properties can be found  here ). Usin