Listing all languages configured in Umbraco w/Razor?
Hi,
I want to populate a dropdown menu on the front end of my site with a list of all of the languages configured in Umbraco under Settings > Languages. I want to include languages that aren't in use on any pages, though, so I can't do this by checking the language settings of nodes. How can this be done in dynamicnode Razor, in, say, a page template?
Thank you, that did the trick. I was able to get the output I wanted as follows:
var languages = ApplicationContext.Services.LocalizationService.GetAllLanguages();
foreach (var language in languages)
{
@language.CultureName;
<text> - </text>
@language.IsoCode;<br>
}
Listing all languages configured in Umbraco w/Razor?
Hi,
I want to populate a dropdown menu on the front end of my site with a list of all of the languages configured in Umbraco under Settings > Languages. I want to include languages that aren't in use on any pages, though, so I can't do this by checking the language settings of nodes. How can this be done in dynamicnode Razor, in, say, a page template?
Thanks!
Hi David,
Didn't use this method before but it looks what you need:
Cheers,
Alex
Thank you, that did the trick. I was able to get the output I wanted as follows:
is working on a reply...