Copied to clipboard

Flag this post as spam?

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


  • Kåre Mai 29 posts 207 karma points
    Nov 17, 2022 @ 09:35
    Kåre Mai
    0

    IPublishedContent only contains "current culture" information

    Hi,

    According to this article here in the Umbraco documentation, IPublishedContent should contain all the language variants, accessible through the language codes.

    However when i query Umbraco with this query inside my controller:

    var selection = _umbracoHelper.Content(Guid.Parse("777c01de-34ab-4630-a2e7-e8bf2b40b35e")).ChildrenOfType("oplevelse");
    

    It only contains the default culture info. If i hover over ".ChildrenOfType" it states the following:

    culture: The specific culture to filter for. If null, the default culture will be used.

    But I need all the language variants. How do I return IPublishedContent which includes all the variants without having to do a query for every single language?

  • Kåre Mai 29 posts 207 karma points
    Dec 15, 2022 @ 12:31
    Kåre Mai
    0

    After upgrade to Umbraco 11 i now get all the language variants in one call.

  • Amigo 243 posts 568 karma points
    Aug 06, 2023 @ 21:10
    Amigo
    0

    How do you do it in one call in U11? If I try your "selection" I still only get for the "main" culture.

    But they can be found with .ChildrenOfType("oplevelse", culture) for each culture.

    Thomas

Please Sign in or register to post replies

Write your reply to:

Draft