Umbraco 13, Block Grid > RTE > Embedded Block Editors Don't Always Render
a
I'm trying to find out how to render the element within RTE strings? I'm guessing that I need to execute a helper method of some kind to scan and render out detected block editors.
s
@Model.Propertyname
should work like before? 🤔
a
@Sebastiaan In my case, I'm getting the value of an RTE field in a ViewComponent, and it isn't converting (which, yeah, I get, I haven't told it to convert anything) https://cdn.discordapp.com/attachments/1184895867522646196/1184898232543879279/image.png?ex=658da578&is=657b3078&hm=214200a19d3514be1f5e16182e9d309c084962699b69408f92b1a2151e31ff2b&
s
Oh, I'm out, no idea, never used a
ViewComponent
but do you have the required partial views in place as described under
Rendering Blocks
?
a
yes
I'm getting this output: Lorem ipsum. In in pulvinar neque
so I am getting the proper value, just wondering how to render that block in the valuke
a
ok, I misread the doc you shared, I'm going to try again
s
My block is aliased
thisIsABlock
by the way!
a
I think the issue is that in my case, I am getting the value via a viewcomponent instead of rendering it via thestandard umbraco pipeline. I may try to look through the source code to see how it is being rendered
I found the function that parses the rtes: RenderRichTextBlockModel It is a private function within RteMacroRenderingValueConverter, a value converter. This value converter appears to fire on basic umbraco page renders, but not when fetching content from a ViewComponent. I need to execute the RteMacroRenderingValueConverter, but I'm not sure how to? https://cdn.discordapp.com/attachments/1184895867522646196/1184918414440017950/image.png?ex=658db844&is=657b4344&hm=1efb75f58d538dc6e73d17543c7fb109413ba0985c2825a82255378b6f8f775c&
my bad, the value converter IS running. I'm debugging.
Ok, the issue is not ViewComponents or anything else. It does parse my block editor. It cannot locate my partial view - and I don't know why yet.
m
It looks like your file is not following View components conversion - The search paths can be found on https://learn.microsoft.com/en-us/aspnet/core/mvc/views/view-components?view=aspnetcore-8.0#view-search-path View Name unless set by you is Default
a
@Sebastiaan @Matt Wise I found the issue. RTE fields in a document type renders any embedded block correctly. The problem is that RTEs in a Block Grid are not being processed, as of 13.0.2. This is either a bug in Umbraco or I need different steps to follow in order to render RTE fields within Block Grids so that they can parse embedded blocks.
Wait, my test randomly started working after a republish, I'm going to look deeper
I can confirm the following given a clean install of umbraco 13.0.2: 1. RTE fields directly in a document type that have embedded blocks always render correctly 2. Block Grid fields that contain RTE fields that have embedded blocks sometimes render, and sometimes don't
I've opened a bug report.
j
Thanks for the detailed thread Aaron. I'm getting the same experience in 13.0.3. I'll steer clear of blocks in the RTE for now.
Just to add a little, when I try to attach a debugger to the Partial I get this. Seems to suggest there's a cached version somewhere? https://cdn.discordapp.com/attachments/1184895867522646196/1196391113012027482/image.png?ex=65b7750d&is=65a5000d&hm=222f7b70da081bdcc8ff8a51d351e07db172892fcaeb50647b73054c19ba5f96&
a
@User I am working on the backoffice view for the RTE within the block grid, i have started on my rte view and I was just wondered if there was already a method to output "umb-rte-block" within the block grid rendering in the backoffice?
282 Views