Problem with nedsted content in separate partial views
Hey!
I am currently working with nested content, where i want to render my nested content in separate partial views. I have tried to use the same method as you can use in Umbraco7 just with some difference. My problem is, that I get this error when i am rendering "item" in my partial view. I need "item" to get access to my data.
At the top of the Layouts/Banner does your
@inherits have UmbracoViewPage<IPublishedContent> if so it will need to be UmbracoViewPage<IPublishedElement>.
This is due to nested content items needing to be an element type in V8
Hey Matthew,
Thanks for the answer, the error is gone now. But I don't understand why i cant see my banner on the website.
This is how the partial view look like?
Do i really have to import var layouts = Model.Value<IEnumerable<IPublishedElement>>("content"); again in this view or?
Problem with nedsted content in separate partial views
Hey! I am currently working with nested content, where i want to render my nested content in separate partial views. I have tried to use the same method as you can use in Umbraco7 just with some difference. My problem is, that I get this error when i am rendering "item" in my partial view. I need "item" to get access to my data.
Anyone who can help?
Hi Isabel
At the top of the
Layouts/Banner
does your @inherits haveUmbracoViewPage<IPublishedContent>
if so it will need to beUmbracoViewPage<IPublishedElement>
.This is due to nested content items needing to be an element type in V8
Hope this helps
Matt
Hey Matthew, Thanks for the answer, the error is gone now. But I don't understand why i cant see my banner on the website. This is how the partial view look like?
Do i really have to import
var layouts = Model.Value<IEnumerable<IPublishedElement>>("content");
again in this view or?No in your partial it should be the banner you passed.
feature banner may need to be
IEnumerable<IPublishedContent>
if the media picker can allow multiple to be selected in the CMSI was just a stupid mistake. My alias is not "featuredBanner" but something else. I can see my banner now. Thanks alot for the help!
is working on a reply...