Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phil Crowe 192 posts 256 karma points
    Oct 28, 2016 @ 09:46
    Phil Crowe
    0

    Get all domains for current culture

    In Umbraco 4 there use to be a method to obtain all the domains for the current culture GetCurrentDomains(). I can't find an equivalent way to do this in Umbraco 7.2+ API. Before I start writing a dirty new method to do this, is there a way in existence?

  • Alex Skrypnyk 6132 posts 23951 karma points MVP 7x admin c-trib
    Oct 28, 2016 @ 12:48
    Alex Skrypnyk
    100

    Hi Phil,

    Of course there is method in Umbraco 7 for getting all domains. Try this one:

    var domains = ApplicationContext.Current.Services.DomainService.GetAll(true).Where(x => x.LanguageIsoCode == System.Threading.Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName);
    

    Hope it will help.

    Thanks,

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft