Copied to clipboard

Flag this post as spam?

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


  • Martin Rud 232 posts 902 karma points c-trib
    Mar 05, 2024 @ 09:46
    Martin Rud
    0

    Content from Rich Text Block Items is "empty" when the rich property is in an Umbraco.BlockList item

    Umbraco version 13.1.1

    When I am using Umbraco.Cms.Core.Models.Blocks.RichTextBlockItem's on properties that are directly on a node then are rendered fine in the frontend using Model.Value("rteProperty").

    But when the RTE property is on a Umbraco.BlockList item then in the frontend it just renders the same as I can see in the backend in HTML source if the RTE. Something like:

    <umb-rte-block class="ng-scope ng-isolate-scope" data-content-udi="umb://element/045f07a2fc524f6b883a03be7e810880"><!--Umbraco-Block--></umb-rte-block>
    

    Sometimes it works when I have just create the block list item, but if I edit it then the frontend is showing

    This is my code for the block list item (Model.Content.Value("text") holds the RichTextBlockItem):

    @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.RichTextBlockItem>
    @{
        var figureLabel = Model.Content.Value<string>("figureLabel") ?? "";
        var figureText = Model.Content.Value<string>("figureText") ?? "";
    
        <aside class="factbox">
            <figure>
                @Model.Content.Value("text")
                @if(figureLabel != "" || figureText != "")
                {
                    <figcaption>
                        @if(figureLabel != "")
                        {
                            <strong class="factbox__caption-label">@figureLabel</strong>
                        }
                        @if(figureText != "")
                        {
                            <div class="factbox__caption-text">@Html.Raw(figureText)</div>
                        }
                    </figcaption>
                }
            </figure>
        </aside>
    }
    
  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    Mar 05, 2024 @ 10:22
  • Martin Rud 232 posts 902 karma points c-trib
    Mar 05, 2024 @ 10:41
    Martin Rud
    0

    Thanks - I upgraded to 13.2.0-rc and it works :)

Please Sign in or register to post replies

Write your reply to:

Draft