Skip to content

Instantly share code, notes, and snippets.

@mskutta
Created January 19, 2016 17:03
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 mskutta/3c9897957b9e6cece72e to your computer and use it in GitHub Desktop.
Save mskutta/3c9897957b9e6cece72e to your computer and use it in GitHub Desktop.
Performing Language Fallback to English if the context language does not exist.
public class GeneralController : GlassController
{
public ActionResult Content()
{
var english = LanguageManager.GetLanguage("en");
using (new LanguageItemFallback(english))
{
var model = GetContextItem<IContent>(inferType:true);
return View(model);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment