Hi Just wondering if it was possible to inherit from umbraco.MacroEngines.DynamicNodeContext to have a custom pageBaseType for razor views?
I've tried:
public abstract class MyViewPage : umbraco.MacroEngines.DynamicNodeContext
{
public MyHelper My { get; set; }
public override void InitHelpers()
{
base.InitHelpers();
My= new MyHelper<object>(base.ViewContext, this); }
}
Custom Razor Page Base Type
Hi Just wondering if it was possible to inherit from umbraco.MacroEngines.DynamicNodeContext to have a custom pageBaseType for razor views?
I've tried:
The base class doesn't contain a viewcontext to hook in to. I was wondering what was required to hook this up?
Which Umbraco version are you using?
umbraco.MacroEngines.DynamicNodeContext
is only used for the old Razor Macros, which are deprecated as of v6.If you're using full MVC views (in the Views folder), you'd probably want to inherit from
UmbracoViewPage
orUmbracoTemplatePage
.What are you trying to achieve?
Asbjørn
is working on a reply...