Copied to clipboard

Flag this post as spam?

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


  • Ruder Partap Singh 28 posts 142 karma points
    Jan 20, 2022 @ 21:07
    Ruder Partap Singh
    0

    Set fallback language in blockList editor

    Hi

    I am using default template to render blocklist in umbraco 9. I've 2 languages, NL and EN. I want to set the fallback language for the BlockList editors values, but its not rendering. My code is

     @Html.GetBlockListHtml(Model,"blockQuote")
    

    and my blocklist template is

    @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockListItem>
        @using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
        @{
            var quoteList = (ContentModels.QuoteBlockList)Model.Content;
        }
    
        @if (quoteList != null)
        {
                <p>@quoteList.Value("blockItemName", fallback: Fallback.ToLanguage)</p>
        }
    

    but its null for the second language, May be because model is null in case of second language.

    Thanks

  • Dennis 75 posts 398 karma points MVP 2x
    Jan 26, 2022 @ 15:01
    Dennis
    0

    Hi there!

    I can't say for sure, but in Umbraco 8, usually the different languages are only available on the entire editor. So you'd have an entirely different block list in each language, rather than different languages for each individual item in the block list.

    I would assume that this is still the case in Umbraco 9

Please Sign in or register to post replies

Write your reply to:

Draft