Copied to clipboard

Flag this post as spam?

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


  • Nso 18 posts 87 karma points
    Jan 09, 2018 @ 20:54
    Nso
    0

    Vorto specify fallback lang

    Hey! How can I specify fallback lang using vorto?

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage<ContentModels.ContentPageBase>
    @using ContentModels = Umbraco.Web.PublishedContentModels;
    @using Our.Umbraco.Vorto.Extensions
    @{
        Layout = null;
    }
    
    <html>
        <head>
            <title>@Model.Content.GetVortoValue("title")</title>
        </head>
        <body>
            <p>@Model.Content.GetVortoValue("lead")</p>
        </body>
    </html>
    

    This is my code.

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Jan 09, 2018 @ 22:16
    Alex Skrypnyk
    0

    Hi

    Where are you storing fallback lang data?

    Alex

  • Amir Khan 1282 posts 2739 karma points
    Jan 09, 2018 @ 22:20
    Amir Khan
    0

    Hi Nso,

    Its built in, just pass the default language along with the property you're trying to get like this:

    For a grid property: @Html.Partial("Grid/Standard", Model.Content.GetVortoValue("grid", "en"))

    For a simpler one like a text string: @Model.Content.GetVortoValue("grid", "en")

    Hope this helps,

    Amir

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Jan 10, 2018 @ 15:15
    Alex Skrypnyk
    0

    Amir, second param in "GetVortoValue" is "cultureName", I think we need "fallbackCultureName"

  • Nso 18 posts 87 karma points
    Jan 10, 2018 @ 07:38
    Nso
    0

    I am changeing the default language with hosts and domain.

  • Nso 18 posts 87 karma points
    Jan 10, 2018 @ 07:38
    Nso
    0

    It is making English for all

  • Amir Khan 1282 posts 2739 karma points
    Jan 10, 2018 @ 14:57
    Amir Khan
    0

    Hi Nso,

    Do you have the culture / hostnames / domain set for each of your languages in Umbraco?

    Should look something like this: http://www.domain.com/en > set language to en http://www.domain.com/es > set language to es

    -Amir

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Jan 10, 2018 @ 15:12
    Alex Skrypnyk
    100

    Hi Guys

    I think you have to use this code:

    <p>@Model.Content.GetVortoValue("lead", fallbackCultureName: "en")</p>
    

    Specify "fallbackCultureName" param name.

    Thanks,

    Alex

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Jan 14, 2018 @ 20:39
    Alex Skrypnyk
    0

    Hi Nso

    Did you solve the issue?

    Thanks,

    Alex

Please Sign in or register to post replies

Write your reply to:

Draft