I have a page Events. On my Events page I have a property EventsGrid. I would like to list the top 4 events from that EventsGrid in a Partial View that I can then replicate in multiple locations on the website.
My question is how to parse the children of the Events Grid on the Events page within my Partial View?
I'm thinking I start here:
@inherits Umbraco.Web.Mvc.UmbracoViewPage<Events>
If that's correct (which I'm not sure it is), I don't know how to get to the children of the property EventsGrid. EventsGrid is using a Doctype called wStationery.
Q: what kind of property is EventsGrid? Is this a MultiNode TreePicker?
A: Here's the hierarchy of Doctypes at play here...
Events (page) >
Events Grid (property of Events page) >
wStationery (property editor for Events Grid) >
wStationeryGrid (property of wStationery) >
wGrid (property editor for wStationeryGrid) >
wGridGridItems (property of wGrid) >
wGridItem (property editor for wGridGridItems)
Q: Are the Event Items direct children of your page Events?
A: Unfortunately no. This was my first umbraco site...i wasn't that advanced at the time. I've since learned how to set up parent/children pages like that, but not in this case.
To clarify the ask, i'm hoping to pull in data from the first 4 wGridItems (there are multiple wGridItem in the containing wGrid), into a partial view that I can then duplicate in multiple locations throughout the site.
Populate Partial View From Page Property
I have a page Events. On my Events page I have a property EventsGrid. I would like to list the top 4 events from that EventsGrid in a Partial View that I can then replicate in multiple locations on the website.
My question is how to parse the children of the Events Grid on the Events page within my Partial View?
I'm thinking I start here:
If that's correct (which I'm not sure it is), I don't know how to get to the children of the property EventsGrid. EventsGrid is using a Doctype called wStationery.
This is the code from my Events page:
I'm not even entirely sure what I'm trying to do is even possible.
Umbraco v 7.6.4
Hi bh,
what kind of property is
EventsGrid
? Is this a MultiNode TreePicker?Are the
Event Items
direct children of your pageEvents
?Maybe it would be handy to show us a preview of your content structure.
Thanks.
/Michaël
Q: what kind of property is EventsGrid? Is this a MultiNode TreePicker? A: Here's the hierarchy of Doctypes at play here...
Events (page) >
Events Grid (property of Events page) >
wStationery (property editor for Events Grid) >
wStationeryGrid (property of wStationery) >
wGrid (property editor for wStationeryGrid) >
wGridGridItems (property of wGrid) >
wGridItem (property editor for wGridGridItems)
Q: Are the Event Items direct children of your page Events? A: Unfortunately no. This was my first umbraco site...i wasn't that advanced at the time. I've since learned how to set up parent/children pages like that, but not in this case.
Hi Ben
It's not clear what property editors you are using and how it looks in the umbraco back-office
Can you show Umbraco back-office? Property editors and hierarchy
/Alex
Here's the DocType for my Community Events page (note the wStationery property editor):
Here's the DocType for wStationery (note the wGrid property editor):
Here's the DocType for wGrid (note the wGridItem property editor):
Here's the DocType for wGridItem:
Hope that clears up the hierarchy of DocTypes/property-editors.
To clarify the ask, i'm hoping to pull in data from the first 4 wGridItems (there are multiple wGridItem in the containing wGrid), into a partial view that I can then duplicate in multiple locations throughout the site.
@AlexSkrypnyk any suggestions?
is working on a reply...