I have started to learn Umbraco recently, and now want to use my MVC skills together with ModelsBuilder.
My Issus is that i want to make a About us page, with dynamic content (whoe we are, etc.). I have then created a doctype for employees, that are allowed children for the about us doctype.
I know how to loop through the children and display the content directly on the about us page, with the "old style" Umbraco (var selection = CurrentPage.Children......)
Is there any way to do that with the models created in modelsbuilder, or do i have to add a partial view for that?
Modelsbuilder and looping through child nodes
I have started to learn Umbraco recently, and now want to use my MVC skills together with ModelsBuilder. My Issus is that i want to make a About us page, with dynamic content (whoe we are, etc.). I have then created a doctype for employees, that are allowed children for the about us doctype.
I know how to loop through the children and display the content directly on the about us page, with the "old style" Umbraco (var selection = CurrentPage.Children......) Is there any way to do that with the models created in modelsbuilder, or do i have to add a partial view for that?
Hi David
It's the same as for "old style", just add right "inherits" declaration:
And get children nodes:
I hope it will help you, have a nice evening!
Thanks,
Alex
Thank you very much Alex! I didn't realise it was going to be that easy :-)
David
You are welcome! Have a nice day.
Alex
is working on a reply...