Copied to clipboard

Flag this post as spam?

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

  • Emil Lindgren 28 posts 190 karma points
    Apr 08, 2020 @ 12:37
    Emil Lindgren

    Cultured root node in controller

    Hello, i have a question about getting the cultured homenode in umbraco 8 in the controller.

    I have a homenode with different languages, example /it,/es, /sv. And i want to get the root node of these. and when im getting it with my code i only get the english version.

    anyone have any clue ? here is my code

     private List<IPublishedContent> GetProductsToFilter()
            var home = Umbraco.ContentAtRoot().First();
            if (home == null)
                return null;
            var homeChildren = home.Children;
            var mainProductsPage = homeChildren?.Where(p => p.ContentType.Alias == "products").FirstOrDefault();
            if (mainProductsPage == null)
                return null;
            List<IPublishedContent> umbracoProducts = new List<IPublishedContent>();
            foreach (var products in mainProductsPage.Children)
                // 1. We take 'products' with
                // 2. children of type 'filter'
                // 3. where is only one 'filter' child
                var productFilter = products.Children;
                if (productFilter == null)
                if (productFilter.Count() == 1 &&
                    productFilter.FirstOrDefault().ContentType.Alias.Equals("filterOption") &&
            return umbracoProducts;

    Kind regards/ Emil

  • Yakov Lebski 534 posts 2095 karma points
    Apr 08, 2020 @ 14:26
    Yakov Lebski

    I guess what you can change Thread culture?

  • Alex Skrypnyk 6112 posts 23606 karma points MVP 7x admin c-trib
    Apr 14, 2020 @ 20:41
    Alex Skrypnyk

    Hi Emil

    Try this code for getting home node:

    var home = Umbraco.AssignedContentItem.AncestorOrSelf(1);

    How did you make a multicultural solution with Umbraco 8?

    Thanks, Alex

Please Sign in or register to post replies

Write your reply to: