Copied to clipboard

Flag this post as spam?

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


  • Peter Hansen 29 posts 72 karma points
    Dec 19, 2019 @ 21:10
    Peter Hansen
    0

    Hi there,

    This is probably not that difficult and may not relate to Umbraco (maybe it's more of a ASP.NET question).

    Basically I have a masterpage (let's call it MPA) with a template. Another masterpage (MPB) with another template has its layout to point at MPA. Inside MPA's template plain HTML goes with a RenderBody. Inside MPB's template there's HTML and another RenderBody to handle MPB's subpages.

    Now, with the ModelsBuilder enabled I get this error when trying to load a subpage to MPB:

    Cannot bind source content type Umbraco.Web.PublishedContentModels.TypeSubPage to model content type Umbraco.Web.PublishedContentModels.MPB
    

    The MPA-HTML has

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage<Umbraco.Web.PublishedContentModels.MPA>
    

    and same with MPB

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage<Umbraco.Web.PublishedContentModels.MPB>
    

    ...and the same goes with the subpage template and layout to point at MPB.

    I am not entirely sure what the error is telling me and how to fix it.

    Anyone?

    -p

  • Peter Hansen 29 posts 72 karma points
    Dec 21, 2019 @ 15:18
    Peter Hansen
    100

    Seems like the sub document types (that are listed under MPB) have to inherit from the MPB-type in the 'Document Types'. This is most unfortunate because this also makes the subs inherit all properties from MPB document type which is not preferable.

    This is what I would call intentionally ugly.

Please Sign in or register to post replies

Write your reply to:

Draft