November Happy Hour will be moved to Thursday December 5th.
AI OnAI Off
November Happy Hour will be moved to Thursday December 5th.
I have made this working by creating one View where model is basetype and then register this view in a InitializableModule that implements IViewTemplateModelRegistrator.
public void Register(TemplateModelCollection viewTemplateModelRegistrator)
{
viewTemplateModelRegistrator.Add(typeof(ContentBasePage),
new EPiServer.DataAbstraction.TemplateModel()
{
Name = "PageTeaser",
Description = "Displays a teaser of a page.",
Path = "~/Views/Shared/_PageTeaser.cshtml",
Inherited = true
}
);
}
Thanks Mari, I've just got this way working myself as well using the EpiServer MVC template as an example. I love this approach because of the ability to pass tags in so you can control which is used. I'll mark this as accepted as this is the best approach I've found
I have a ContentArea that pages can be added to and rather than creating a separate render for each type using a .cshtml I want one for the base class it's inherited from. I've tried generic controllers, overiding the editor and faking it http://joelabrahamsson.com/custom-rendering-of-content-areas/ and other techniques but I can't get it working.