Quick Fixes: Language Ordering

Say you want to add a language switcher to your site. Simple enough, right? Now say your users want to control the order the languages appear in. Somewhat surprisingly, when you get languages from an item or from the context database, the order they're retrieved in doesn't reflect their order in the content tree.

To work around this, you can retrieve the associated items and order them by their sort order using the LanguageManager.GetLanguageItem(language, database) method.

Comments

Popular posts from this blog

Quick Fixes: Rendering Parameters and Standard Values

Mega Solutions for Mega Menu Problems