-
-
Save jonathanread/07ae66b1566cb0df5c7bd4640e999446 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using Telerik.Sitefinity.GenericContent.Model; | |
using Telerik.Sitefinity.Modules.Libraries; | |
using Telerik.Sitefinity.Libraries.Model; | |
namespace SitefinityWebApp.Helpers | |
public static class DocumentHelpers | |
{ | |
public static Dictionary<string, string> GetLanguageUrls(this Document document) | |
{ | |
Dictionary<string, string> languageUrls = new Dictionary<string, string>(); | |
if (document != null) | |
{ | |
var languages = document.AvailableLanguages.ToList(); | |
if (languages.Count > 2) | |
{ | |
languages.ForEach(lng => languageUrls.Add(lng, document.ItemDefaultUrl[lng].ToString())); | |
} | |
} | |
return languageUrls; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment