Copied to clipboard

Flag this post as spam?

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


  • Matt Taylor 873 posts 2086 karma points
    Feb 12, 2015 @ 19:05
    Matt Taylor
    0

    Nested templates

    Before the days of MVC when I was using webforms I would created a few layers of templates so I didn't repeat common HTML.

    I thought I could do something similar in the Hybrid Framework.

    Currently we have the Master template

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<IMasterModel>

    and everything inherits from that.

    I wanted to create the following structure:

    Master
    -- Home
    -- Page With Side Navigation
    -- -- Content Page
    -- -- Some other page that will have a side nav
    -- Gallery

    so that I can put my subnavigation rendering code on one template and have some of the others inherit it.

    I thought I'd be able to use:

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<MasterModel<Menu>>

    for my Page With Side Navigation template as that would give me access to some the common 'Content' properties I need on the page but I can only get it to work using

    @inherits Umbraco.Web.Mvc.UmbracoViewPage<IMasterModel>

    otherwise it just complains about the type of model being passed in.

    Can I do this in v7? I was able to do it in v6 by using the BaseModel.

    Regards, Matt

Please Sign in or register to post replies

Write your reply to:

Draft