I'm fairly new to this, so this might be trivial. On my website I have a page "News" which is in Grid layout (mostly contains RTE content). What I'm trying to do is to show first content of the grid on home page. I already loaded the grid from News page to the Home page, but I can't seem to get specific content from it. I tried to convert GridHtml into string and use it as an array and just use split but I can't display images this way. Is there a simple way to get specific content from grid (or just show it)?
One of the limitations is that the data in the grid is store as a JSON object which 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 - it simply wasn't designed for this scenario. If you wish to reuse content in multiple pages, it is still recommended that you store these pieces of content as separate content nodes, so they can be stored, cached and queried as usual.
Selecting specific row from Grid
Hi,
I'm fairly new to this, so this might be trivial. On my website I have a page "News" which is in Grid layout (mostly contains RTE content). What I'm trying to do is to show first content of the grid on home page. I already loaded the grid from News page to the Home page, but I can't seem to get specific content from it. I tried to convert GridHtml into string and use it as an array and just use split but I can't display images this way. Is there a simple way to get specific content from grid (or just show it)?
Thanks in advance
Hi Jakub and welcome to our.
One of the thing that we write in our documentation when you work with the grid in Umbraco is about best practices and limitations.
You can find it here. https://our.umbraco.org/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Grid-Layout/Grid-Layout-Best-Practices
One of the limitations is that the data in the grid is store as a JSON object which 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 - it simply wasn't designed for this scenario. If you wish to reuse content in multiple pages, it is still recommended that you store these pieces of content as separate content nodes, so they can be stored, cached and queried as usual.
See https://our.umbraco.org/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Grid-Layout/Grid-Layout-Best-Practices#limitations
Best,
/Dennis
is working on a reply...