Blocklist with child lists
# help-with-umbraco
t
Hi I have a nested blocklist. Inside the parent I have a few child items. On a page I'm displaying all child items. In the scenario how could I retrieve the parent blocklist in my razor view? Thank you
o
You could add a parent property in the child model, then when you are rendering the parent, set the parent property of the child?
t
Do you mean in under the components folder where I have the view (blocklist I think) I could do something like Model.Parent? If yes I tried that but it didn't work
l
Which razor view is it youre trying to retrieve all the block list items from the parent? The doc type view (home page, content page etc), or within the block list view (in the blocklist folder)? How you would achieve this would depend on which route, as well as a few other factors.
t
It would be the blocklist folder but I'd be interested in knowing if it was inside a View as I may have the same issue in another area with a View 👍
2 Views