We have a setup where a landing page pulls through the child node elements and displays them within itself.
Is it possible to put a Grid on a child node and display it on the parent?
I've included the code we've used to loop through the child elements to pull the old RTE field and my guess at what I thought would pull through the Grid.
Looking through some other forum posts it looks like others have tried to add a grid to the parent and display it on a child but its not currently possible so I'm guessing what I'm trying isn't eiether.
It says - With the above usage scenarios in mind, consider the grids limitations. First of all, all content entered into the grid is stored as a single property value on the content node, as a big JSON object. This means that as soon as the values are stored in the database, there is no managed api to drill into the grid content and target specific cell content - so a grid layout is not a recommended storage of reusable content
I had seen the best practice page but hoped I had not understood it properly! In this specific scenario bringing back the entire grid would have been fine as we didn't need to drill into specific elements.
I know this is from a while back, but can't easily find anything more recent that answers this.
I've been able to get this to work. Essentially I have a "Home" page for the site with a "Site Settings" node beneath it. In my Master template I fetch all the "Site Settings" content using the following:
Rendering the Grid Layout On It's Parent Node
Hi.
We have a setup where a landing page pulls through the child node elements and displays them within itself.
Is it possible to put a Grid on a child node and display it on the parent?
I've included the code we've used to loop through the child elements to pull the old RTE field and my guess at what I thought would pull through the Grid.
Looking through some other forum posts it looks like others have tried to add a grid to the parent and display it on a child but its not currently possible so I'm guessing what I'm trying isn't eiether.
Cheers
Chris
Hi Chris,
From the documentation, it´s not able to reuse the content from a grid layout on other pages.
Try to see https://our.umbraco.org/documentation/using-umbraco/backoffice-overview/property-editors/built-in-property-editors-v7/grid-layout documentation on the grid layout and specific this section abut limitations. https://our.umbraco.org/Documentation/Using-Umbraco/Backoffice-Overview/Property-Editors/Built-in-Property-Editors-v7/Grid-Layout-Best-Practices#Limitations
It says - With the above usage scenarios in mind, consider the grids limitations. First of all, all content entered into the grid is stored as a single property value on the content node, as a big JSON object. This means that as soon as the values are stored in the database, there is no managed api to drill into the grid content and target specific cell content - so a grid layout is not a recommended storage of reusable content
Hope this helps,
/Dennis
Thanks Dennis.
I had seen the best practice page but hoped I had not understood it properly! In this specific scenario bringing back the entire grid would have been fine as we didn't need to drill into specific elements.
Thanks for the quick response.
Cheers
Chris
Hi Chris,
I know this is from a while back, but can't easily find anything more recent that answers this.
I've been able to get this to work. Essentially I have a "Home" page for the site with a "Site Settings" node beneath it. In my Master template I fetch all the "Site Settings" content using the following:
For simple text field content I use:
Then for the grid content stored in "Site Settings" I do the following:
I hope that helps (and works for you).
Keep well, Michael
is working on a reply...