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
OMegaliterosMalakas
10/08/2024, 3:18 PM
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
TigerMan
10/08/2024, 3:26 PM
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
Lewis Heaton
10/08/2024, 3:40 PM
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
TigerMan
10/08/2024, 4:59 PM
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 👍