One of the most common items I have to deal with is managing Sitecore items in .NET. I'm often looking for the url of the item so I can link to it on the page, I thought I would share this with the world.
Sitecore.Context.Item.Paths.GetFriendlyUrl();
Or
Item sitecoreItem = Sitecore.Context.Item;
String itemUrl = sitecoreItem.Paths.GetFriendlyUrl();
Very simple to do but not well documented.
Subscribe to:
Post Comments (Atom)
4 comments:
classic! thanks
Sitecore functionality, not well documented? No surprise there. Thanks for this.
The new version of this is:
Sitecore.Links.LinkManager.GetItemUrl(item);
Hi there, I am new to Infopath and I really appreciate all this great information. Thanks for it.
Post a Comment