Skip to content

Instantly share code, notes, and snippets.

@jonathanread
Created January 31, 2020 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanread/07ae66b1566cb0df5c7bd4640e999446 to your computer and use it in GitHub Desktop.
Save jonathanread/07ae66b1566cb0df5c7bd4640e999446 to your computer and use it in GitHub Desktop.
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