public class SomeClass { public void SomeMethod() { var urlOptions = UrlOptions.DefaultOptions; urlOptions.Language = language; var link = LinkManager.GetItemUrl(item, urlOptions); } }
Tuesday, 19 March 2013
How to get Language Specific Links from Sitecore
By default Sitecore's Link Manager class will return you a link in the context language, this is great when you have a single language site. If you have a multi-lingual site however, this can be quite annoying, especially if you want to do a "this page is also available in X language". So here is the snippet for doing it, the key part being urlOptions.Language.
Subscribe to:
Post Comments (Atom)
How to disable "Add Users" in Sitecore's Platform DXP
I have seen a few posts going around the community asking how to disable the "Add Users" button in Sitecore Platform DXP. This ...
-
Lately I have been doing some work with Sitecore 7 and I had a requirement to work with the webforms rendering engine(as opposed to the MVC ...
-
This week I had the opportunity to attend both the Sitecore Partner Summit and Trendspot down here in Sydney. Off the back of attending I th...
-
So I was working through an issue with a customer recently and we couldn't work out why a certain behavior was happening and why it appe...
No comments:
Post a Comment