Developer forum

Forum » Templates » Error in cookies template

Error in cookies template

Ivan Marijanović
Ivan Marijanović
Reply

Hi

After we enable cookie manager and set it ot use Template based warnings - ModalWarning.cshtml we get following error on page:

 

Error compiling template "CookieWarning/ModalWarning.cshtml"
Line 80: The name 'Render' does not exist in the current context
Line 216: The name 'RenderBlockList' does not exist in the current context

Thank You in advance.

 

Sincerely

Ivan


Replies

 
Nicolai Pedersen
Reply

Did you enable it on a Rapido solution - or did you get the template from somewhere. It looks like the template is coming from another Dynamicweb implementation.

 
Ivan Marijanović
Ivan Marijanović
Reply

It is Rapido template. This is content:

 

@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>>
@using Dynamicweb.Rapido.Blocks
@using Dynamicweb.Rapido.Blocks.Components.General

@functions {
    BlocksPage modalWarningPage = BlocksPage.GetBlockPage("ModalWarningPage");
}

@{
    Block cookieModal = new Block
    {
        Id = "CookieModal",
        SortId = 10,
        Component = new Modal
        {
            Id = "Cookie",
            Heading = new Heading { Title = Translate("This website use cookies"), Level = 2 },
            Width = ModalWidth.Sm,
            BodyTemplate = RenderCookieForm()
        }
    };

    modalWarningPage.Add(cookieModal);

    Block cookieScript = new Block
    {
        Id = "CookieScript",
        SortId = 20,
        Template = RenderCookieScript(true)
    };

    modalWarningPage.Add(cookieScript);
}


@Include("Blocks/CookieForm.cshtml")
@Include("Blocks/CookieScript.cshtml")
@Include("Blocks/Custom__Blocks.cshtml")

@* The @RenderBlockList base helper is included in Components/GridBuilder.cshtml *@
@RenderBlockList(modalWarningPage.BlocksRoot.BlocksList)

 

 
Nicolai Pedersen
Reply

Yes, but did you include it on a non-rapido solution?

 
Ivan Marijanović
Ivan Marijanović
Reply

No! Standard Rapido solution. Hosted on DW server.

 

Ivan

 

You must be logged in to post in the forum