Copied to clipboard

Flag this post as spam?

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


  • Dan Evans 629 posts 1016 karma points
    Aug 27, 2019 @ 11:41
    Dan Evans
    0

    Default content / media for variants

    We are using language variants to create sites in multiple languages.

    In previous versions of Umbraco we used to literally copy/paste an existing site which gave us a sample site and then translate what needed translating. Anything that didn't need translating was already there - for example images.

    Now as far as we can tell when we create a variant it is blank - i.e. everything needs copying/adding even if it doesn't need changing.

    According to the docs it should fallback to the original language:

    https://our.umbraco.com/Documentation/Getting-Started/Design/Rendering-Content/#using-fall-back-methods

    @Model.Value("pageTitle", "fr", fallback: Fallback.ToLanguage)

    Fallback to language is the default.

    Is this correct or is there a way to create a variant via a complete copy of the existing site?

    Thanks

    Dan

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Aug 27, 2019 @ 14:16
    Shaishav Karnani from digitallymedia.com
    0

    Hi Dan,

    This is new feature in Umbraco 8. However, previous version of copy/paste language is still relevant and correct.

    If let us say site templates on 2 languages are different then it is better to use complete copy of the existing site..

    Alternatively, if templates are same and it is just language change then we should use new approach as it is much easier and has fallback feature too.

    Hope this helps. Let me know if you have any other queries and I will try my best to assist.

    Regards,

    Shaishav

  • Dan Evans 629 posts 1016 karma points
    Aug 27, 2019 @ 14:18
    Dan Evans
    0

    Sorry if i wasn't clear. We are using Variants BUT when i create a variant it is completely BLANK. It does not fallback to the original language for any fields that are not completed.

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Aug 27, 2019 @ 14:35
    Shaishav Karnani from digitallymedia.com
    0

    Hi Dan,

    Thanks for the clarification. Please can you check if you have chosen below Fall back language for non default language as this is required.

    enter image description here

    Please check and advice.

    Regards,

    Shaishav

  • Dan Evans 629 posts 1016 karma points
    Aug 27, 2019 @ 14:38
    Dan Evans
    0

    it is indeed...enter image description here

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Aug 27, 2019 @ 15:07
    Shaishav Karnani from digitallymedia.com
    0

    Hi Dan,

    Please can you try this one. I noticed you have "fr" as a parameter. I have tried locally without "fr" and it worked for me fine. It is falling back to default language.

    @Model.Value("menuTitle",fallback: Fallback.ToLanguage)
    

    Cheers, Shaishav

  • Dan Evans 629 posts 1016 karma points
    Aug 27, 2019 @ 15:13
    Dan Evans
    0

    So although it looks like fallback is the default it is not...

    https://github.com/umbraco/Umbraco-CMS/issues/4773

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Aug 27, 2019 @ 15:21
    Shaishav Karnani from digitallymedia.com
    100

    Hi Dan,

    It was automatic for me. I am running v8.1.3

    2 languages (English (default), Spanish (with fallback to english))

    Added 2 domain for English and Spanish.

    Created a field Menu Title with allow varying by culture.

    Now, added value in 'Menu Title' in English and no value in Spanish.

    When I tried to access Spanish page URL then got default Menu Title from English as Spanish was empty using below code.

    @Model.Value("menuTitle",fallback: Fallback.ToLanguage)
    

    Is it not working same way for you please?

    Regards,

    Shaishav

  • Dan Evans 629 posts 1016 karma points
    Aug 27, 2019 @ 15:25
    Dan Evans
    0

    OK now, this makes sense. I had assumed that the fallback was automatic, i.e.

    @Model.Value("menuTitle")

    and not @Model.Value("menuTitle",fallback: Fallback.ToLanguage)

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Aug 27, 2019 @ 16:08
    Shaishav Karnani from digitallymedia.com
    0

    Hi Dan,

    Great! We will need fallback property :)

    Please can we mark this as solved. It will help others.

    Regards,

    Shaishav

  • Dan Evans 629 posts 1016 karma points
    Aug 27, 2019 @ 16:12
    Dan Evans
    0

    Marked as the solution. I guess the reasoning behind it is there are multiple fallback options - https://our.umbraco.com/Documentation/Getting-Started/Design/Rendering-Content/#using-fall-back-methods

    However, it would be good if a default fallback could be specified globally.

Please Sign in or register to post replies

Write your reply to:

Draft