Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
We're creating a baseline site and I'd like to find a way of creating re-usable page elements, e.g. a Call to Action which can be used either as a composition on one type of page where it's static or as a child of another type of page so it can be sorted.
I'm aware I could use the grid for the sorting, but wondered if there is a way of building the partial view so it can be used for both.
If I reference the model using View Page @inherits UmbracoViewPage
If I reference the interface @inherits Umbraco.Web.Mvc.UmbracoViewPage
Is there a way I can do both?
Your code examples don't appear to have come through properly, but I'm assuming you had something like this:
These two variations?
I think you should be able to use the second version to handle both composition behaviour and full page rendering, although you might need to do a cast in order to get it to work. This is because MyComposition will inherit from IMyComposition which might allow you to pass between the two.
I've not tested this so it's just a theory.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted