UrlResolver.Current.GetUrl(item.Href) should get you the "real" url. From that I guess you can look at extension etc to decide what icon to choose.
Thanks that already helps me quite a bit!
Oh, btw. If you want it as an IContent you can do UrlResolver.Current.Route(new UrlBuilder(item.Href)), then you could probably use the type instead.
I have a specific question about the LinkItemCollection property. It holds the LinkItem objects of different types (internal links to pages, external links, email links, links to internal mediafiles etc.). The only property i can find is 'Href' which shows the link. How can i find out what type of link it was?
For instance a pdf file is shown as: /link/46c1ceba004c4d6b9f2fc2bd62c8650a.aspx
Same for internal links to pages.
I can use ' PermanentLinkMapStore.TryToMapped' but this only is part of the solution. Anyone has a good solution for this? My end goal is that i can show Icons at my list of links which vary depending on the type of link.
Thanks in advance,