A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
Hi,
You can try to put this code in ~/Views/Shared/DisplayTemplates/ContentArea.cshtml:
@using EPiServer.Web.Mvc.Html
@model ContentArea
@{
var original = ViewContext.RouteData.Values["currentContent"];
Html.RenderContentArea(Model);
if (original != null)
{
ViewContext.RouteData.Values["currentContent"] = original;
}
}
And this code in ~/Views/Shared/DisplayTemplates/ContentData.cshtml:
@model IContentData
@{
var original = ViewContext.RouteData.Values["currentContent"];
Html.RenderContentData(Model, false);
if (original != null)
{
ViewContext.RouteData.Values["currentContent"] = original;
}
}
See http://joelabrahamsson.com/workaround-on-page-editing-broken-after-rendering-a-block/ for more information.
I have made a block with 3 content areas in it, like so:
Then I add it to another page type like this:
And then in the view:
I can interact with the content areas as expected in forms editing, but in the on-page-editing they're not interactable as I expected, they just show the content added in the forms editing mode.
There should have been 3 content areas between these 2 other content areas. Doesn't the on-page-editing functionality trigger when the content area is in another block?