Copied to clipboard

Flag this post as spam?

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


  • Filipe Sousa 43 posts 205 karma points
    Feb 24, 2020 @ 16:18
    Filipe Sousa
    0

    Variations for user

    Hi all,

    My website is is built in french and english. I want to display my website by default in the user's browser language.

    While it's quite easy to add and populate variations for nodes in the backoffice, I can't seem to find how to get variations for any specific node, within my code. I would then redirect the user to the appropriate variation.

    What's the appropriate way to set this up?

    thanks and cheers,

  • Filipe Sousa 43 posts 205 karma points
    Feb 25, 2020 @ 15:35
    Filipe Sousa
    0

    Found a similar thread here: https://our.umbraco.com/forum/umbraco-8/95909-umbraco-v8-multilanguage.

    The following code works for this purpose:

    foreach (var (culture, infos) in Model.Content.Cultures)
            {
                <a href="@Model.Content.Url(culture)">
                    @Model.Content.Value("name", culture)
                </a>
            }
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies