Copied to clipboard

Flag this post as spam?

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


  • Mohammad Javed 14 posts 95 karma points
    Jul 12, 2023 @ 13:46
    Mohammad Javed
    0

    Syntax Error: Rendering Block List Component

    Hello,

    I am trying to render my block list component on the frontend but I'm keep getting the following error;

    <Data>C:\local\Temporary ASP.NET Files\root\fa51a329\38a188b8\App_Web_richtextcenteredcontent.cshtml.f49d91ab.wz36gjji.0.cs(42): error CS1003: Syntax error, ',' expected at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) at Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) at ASP._Page_Views_Partials_BlockList_Default_cshtml.Execute() in C:\home\site\wwwroot\Views\Partials\BlockList\Default.cshtml:line 11 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) at Umbraco.Web.BlockListTemplateExtensions.GetBlockListHtml(HtmlHelper html, BlockListModel model, String template) at ASP._Page_Views_ContentPage_cshtml.Execute() in C:\home\site\wwwroot\Views\ContentPage.cshtml:line 8 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) </Data>
    

    So this is my content page view;

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<ContentModels.ContentPage>
    @using ContentModels = Umbraco.Web.PublishedModels;
    @{
        Layout = "Master.cshtml";
    }
    
    @Html.GetBlockListHtml(Model, "MainContent")
    
    <p>Some content here.</p>
    

    I've tried using both of the following;

    @Html.GetBlockListHtml(Model, "MainContent")
    

    AND

    @Html.GetBlockListHtml(Model.MainContent)
    

    But for the life of me, I am struggling to find where the problem is. It's an Umbraco Cloud starter package. If I comment the following line out, then the page loads up and the hardcoded HTML in my view is rendered.

    @Html.Partial("BlockList/Components/" + data.ContentType.Alias, block)
    

    This is the content properties that I have set up as a composition so I can reuse this on every page. https://prnt.sc/kv4Z1PMrav38

    Here is the page builder data type I've created: https://prnt.sc/D3VlDZmdQpMa

    Any help would be massively appreciated.

    Thank you,

    Javed

  • Søren Kottal 702 posts 4497 karma points MVP 5x c-trib
    Jul 13, 2023 @ 06:00
    Søren Kottal
    0

    Hi Javed

    What is in \Views\Partials\BlockList\Default.cshtml line 11 and around?

  • Mohammad Javed 14 posts 95 karma points
    Jul 13, 2023 @ 08:13
    Mohammad Javed
    0

    Hi Soren

    This is the code in that file, it was there by default and I've not tinkered with it.

    @inherits UmbracoViewPage<BlockListModel>
    @using Umbraco.Core.Models.Blocks
    @{
        if (!Model.Any()) { return; }
    }
    <div class="umb-block-list">
        @foreach (var block in Model)
        {
            if (block?.ContentUdi == null) { continue; }
            var data = block.Content;
            @Html.Partial("BlockList/Components/" + data.ContentType.Alias, block)
        }
    </div>
    

    And this is the line that it's complaining about;

    @Html.Partial("BlockList/Components/" + data.ContentType.Alias, block)
    

    Do I need to make any changes to this code file?

    Thanks,

    Javed

  • Richard Hamilton 10 posts 81 karma points
    Jul 13, 2023 @ 08:36
    Richard Hamilton
    1

    Try add +".cshtml"

    @Html.Partial("BlockList/Components/" + data.ContentType.Alias + ".cshtml", block)
    

    And make sure you have PartialViews with names that match the docTypeAlias for each blocklist item.

  • Mohammad Javed 14 posts 95 karma points
    Jul 13, 2023 @ 08:49
    Mohammad Javed
    0

    Ok - now that is some progress.

    The next error I am getting is;

    The partial view 'BlockList/Components/richTextCenteredContent.cshtml' was not found or no view engine supports the searched locations. The following locations were searched: ~/Views/RenderMvc/BlockList/Components/richTextCenteredContent.cshtml.aspx
    

    The alias is also correct for the block list item. Here is the Alias for that block: https://prnt.sc/MLWIjrPP5Zjj

    The partial view: https://prnt.sc/sLXGNDEdmE7s

    Thanks,

    Javed

  • Richard Hamilton 10 posts 81 karma points
    Jul 13, 2023 @ 11:11
    Richard Hamilton
    0

    Try using the full path

    ~/Views/Partials/...

    so

    @Html.Partial("~/Views/Partials/BlockList/Components/" + data.ContentType.Alias + ".cshtml", block)
    
  • Mohammad Javed 14 posts 95 karma points
    Jul 13, 2023 @ 11:16
    Mohammad Javed
    0

    So I've done that now;

    @Html.Partial("~/Views/Partials/BlockList/Components/" + data.ContentType.Alias + ".cshtml", block)
    

    It still doesn't like it.

    <Data>C:\local\Temporary ASP.NET Files\root\fa51a329\38a188b8\App_Web_richtextcenteredcontent.cshtml.f49d91ab.cpi7qiz4.0.cs(42): error CS1003: Syntax error, ',' expected at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) at Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) at ASP._Page_Views_Partials_BlockList_Default_cshtml.Execute() in C:\home\site\wwwroot\Views\Partials\BlockList\Default.cshtml:line 12 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) at Umbraco.Web.BlockListTemplateExtensions.GetBlockListHtml(HtmlHelper html, BlockListModel model, String template) at ASP._Page_Views_ContentPage_cshtml.Execute() in C:\home\site\wwwroot\Views\ContentPage.cshtml:line 8 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.
        <BeginInvokeAction>b__1(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<>c.
            <BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<>c.
                <BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 
                </Data>
    
  • Richard Hamilton 10 posts 81 karma points
    Jul 13, 2023 @ 11:24
    Richard Hamilton
    0

    First I'd clean / rebuild. Then look into the partial view itself. It seems to have found the correct partial view now.

  • Mohammad Javed 14 posts 95 karma points
    Jul 13, 2023 @ 11:25
    Mohammad Javed
    0

    It's a site that is on Umbraco Cloud (Starter package) - how would I go about rebuilding the project?

    I can go to Settings > Models and click on Reload.

  • Richard Hamilton 10 posts 81 karma points
    Jul 13, 2023 @ 11:45
    Richard Hamilton
    0

    You should be able to clone locally and work on your local machine.

    But, what's in this file: richtextcenteredcontent.cshtml

  • Mohammad Javed 14 posts 95 karma points
    Jul 13, 2023 @ 11:47
    Mohammad Javed
    0

    This is what is in that file, but the name of the file is the alias richTextCenteredContent.cshtml

    @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockListItem>;
    @using ContentModels = Umbraco.Cms.Web.Common.PublishedModels;
    @{
        var content = (ContentModels.RichTextCenteredContent)Model.Content;
        //var settings = (ContentModels.RichTextCenteredContent)Model.Settings;
    }
    
    <div class="centered block eo">
        <div class="inner">
            <h2 class="line">
                <p> @content.Value("contentHeading") <u style="width:92.4498%"></u></strong></p>
            </h2>
            <p>@content.ContentTextArea</p>
        </div>
    </div>
    
  • Richard Hamilton 10 posts 81 karma points
    Jul 13, 2023 @ 11:59
    Richard Hamilton
    0

    remove </strong>

    and this also looks weird but shouldn't break it <u style="width:92.4498%"></u>

    Actually, why not use

       <h2 class="line">
             <p>@content.ContentHeading</p>
       </h2>
    

    for now and see what happens

  • Mohammad Javed 14 posts 95 karma points
    Jul 13, 2023 @ 12:09
    Mohammad Javed
    0

    I've removed that HTML and it's complaining about a syntax error and is looking at the /View/ContentPage.cshtml

    <Data>C:\local\Temporary ASP.NET Files\root\fa51a329\38a188b8\App_Web_richtextcenteredcontent.cshtml.f49d91ab.mve6fify.0.cs(42): error CS1003: Syntax error, ',' expected at System.Web.Compilation.AssemblyBuilder.Compile() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) at System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) at System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) at Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) at ASP._Page_Views_Partials_BlockList_Default_cshtml.Execute() in C:\home\site\wwwroot\Views\Partials\BlockList\Default.cshtml:line 11 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) at Umbraco.Web.BlockListTemplateExtensions.GetBlockListHtml(HtmlHelper html, BlockListModel model, String template) at ASP._Page_Views_ContentPage_cshtml.Execute() in C:\home\site\wwwroot\Views\ContentPage.cshtml:line 9 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.Mvc.WebViewPage.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass3_1.
        <BeginInvokeAction>b__1(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) at System.Web.Mvc.Controller.<>c.
            <BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.<>c.
                <BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 
                </Data>
    

    Here is the ContentPage.cshtml view.

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<ContentModels.ContentPage>
    @using ContentModels = Umbraco.Web.PublishedModels;
    @{
        Layout = "Master.cshtml";
    }
    
    @Html.GetBlockListHtml(Model.MainContent)
    

    My Data Type: https://prnt.sc/P_ymL6Nxuou9

    Composition: https://prnt.sc/lNsG_e7vjD6V

  • Mohammad Javed 14 posts 95 karma points
    Jul 13, 2023 @ 13:50
    Mohammad Javed
    0

    I believe the problem is with this line of code;

    @inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage<Umbraco.Cms.Core.Models.Blocks.BlockListItem>;
    

    When I comment it out and just add plain HTML with some random text, that is being rendered on the frontend, so it is definitely hitting the correct file.

  • Heather Floyd 604 posts 1002 karma points MVP 5x c-trib
    Jul 13, 2023 @ 15:52
    Heather Floyd
    100

    Hi Mohammad!

    You can also try setting the type of the blocklist model directly in the "inherits":

    @using Umbraco.Core.Models.Blocks
    
    @inherits UmbracoViewPage<BlockListItem<RichTextCenteredContent>>
    

    and if you also had a custom Settings model, it would be something like this:

    @inherits UmbracoViewPage<BlockListItem<RichTextCenteredContent, RichTextCenteredSettings>>
    

    Then, you can access properties like:

    @Model.Content.ContentHeading
    
  • Mohammad Javed 14 posts 95 karma points
    Jul 14, 2023 @ 08:04
    Mohammad Javed
    1

    Wow, that actually worked flawlessly.

    @using Umbraco.Core.Models.Blocks
    @inherits UmbracoViewPage<BlockListItem<RichTextCenteredContent>>
    
    <div class="centered block eo">
        <div class="inner">
            <h2 class="line">
                <p>@Model.Content.ContentHeading</p>
            </h2>
            <p>@Model.Content.ContentTextArea</p>
        </div>
    </div>
    

    I'm in the process of gaining proper admin rights to the cloud project so I can clone it locally and debug using the correct tools.

    Many thanks again to everyone that has contributed. I can now knuckle down and crack on with this project.

Please Sign in or register to post replies

Write your reply to:

Draft