Is there a way to render the content of x child pages onto their parent page? Im using Umbraco 7 and im not very good with razor.
This is my attempt, found on an unanswered post in the umbraco forum: (https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/60936-Grid-on-CurrentPage-Children)
IPublishedContent currentPage = Umbraco.Content(CurrentPage.Id);
IEnumerable<IPublishedContent> children = currentPage.Children().Where(x => x.IsVisible());
foreach(var child in children){
@child.GetGridHtml("grid")
Doesnt work tough. Error: Cannot implicitly convert type 'Umbraco.Core.Dynamics.DynamicNull' to 'Umbraco.Core.Models.IPublishedContent'.
Thanks for your support.
John