Recommendations for macros in a grid/interpretation of best practices
Lets say you have an e-shop, with a grid-like design on three different "article-details"-pages. (1,2 or 3 columns on each row, 6-7 rows, just as an example), with a graphical element on each cell. Many of the the graphical elements occurs on the three different "article-details"-pages
The data will of course be read dynamically depending on what article user ha selected.
Is this a suitable case to use a Umbraco grid containing macro partials?
> "Thou shalt not store of reusable content in Umbraco grids"
. Maybe Im dense, but what is reusable content here? What is recommended for this case? Three different page templates containing
partial views (which gets an "ArticleViewModel". Im not super used to Umbraco and CMS, so Im leaning to a good olĀ“ MVC-way of doing this, which is ok, but I want to do it the Umbraco way....
Welcome to the community and you're definitely not dense. I had the same learning curve at the start, getting my head around the Umbraco "way".
Hopefully I am not telling you how to suck eggs but:
When setting up Umbraco you create document types - these are simplistically containers of data.
Some will have page templates associated with them, some may not.
Ones that don't might be parts of a page - as per the screenshot, Philippa is the "page" which has a template associated for displaying on the website and everything else below makes up the page (I call them strips of content).
Or they might be "reusable" content as per the screenshot below, the same site has a tree structure for the main website, then the blog, then a data container where reusable content is stored.
Then to answer your query re the grid, you could setup functionality in the grid to be able to select some "reusable" content from the data storage area and so this will render out in the page at run time.
For the grid you would need to setup a new option for a content picker to facilitate the above - I don't have code handy for that, but there is one package I know of that would help - Le Blender. It might be a bit overkill for this requirement, but then again, once you start using it you might be able to use the additional features.
Hope this helps and don't hesitate to shout out if you've any more queries.
Hi Nigel
Thanks for your response! I had to look up that idiom, and no, my egg sucking skills are limited when it comes to umbraco so every advice is welcome :)
Although I know about document types and their templates, partials and macros and from what I understand its not possible to use partials in grids, just macros. What datatype are your stripes? Partials?
I have also looked into grid editors and they seem a bit cumbersome if you want to use server side/.cs code.
Are you telling me that with the LeBlender-plugin I can mix dumb "stripes"
with reusable content? And what are reusable content in this context? any template that contains different data depending on product (in my case)
As I see it I can
1)
Create a bunch of macros, one for each graphical element then create 3 instances/pages of a "My Grid Page" in umbraco and drag the macros/stripes as a back office-user would do.
2)
Create 3 Page Templates and a bunch of partials and render them on the 3 page templates RenderPartial() as below
Recommendations for macros in a grid/interpretation of best practices
Lets say you have an e-shop, with a grid-like design on three different "article-details"-pages. (1,2 or 3 columns on each row, 6-7 rows, just as an example), with a graphical element on each cell. Many of the the graphical elements occurs on the three different "article-details"-pages
The data will of course be read dynamically depending on what article user ha selected.
Is this a suitable case to use a Umbraco grid containing macro partials?
Reading from the Umbraco grid best practices it says that
> "Thou shalt not store of reusable content in Umbraco grids"
. Maybe Im dense, but what is reusable content here? What is recommended for this case? Three different page templates containing partial views (which gets an "ArticleViewModel". Im not super used to Umbraco and CMS, so Im leaning to a good olĀ“ MVC-way of doing this, which is ok, but I want to do it the Umbraco way....
Any recommendations for this case?
Hi Newbraco
Welcome to the community and you're definitely not dense. I had the same learning curve at the start, getting my head around the Umbraco "way".
Hopefully I am not telling you how to suck eggs but:
When setting up Umbraco you create document types - these are simplistically containers of data.
Some will have page templates associated with them, some may not.
Ones that don't might be parts of a page - as per the screenshot, Philippa is the "page" which has a template associated for displaying on the website and everything else below makes up the page (I call them strips of content).
Or they might be "reusable" content as per the screenshot below, the same site has a tree structure for the main website, then the blog, then a data container where reusable content is stored.
Then to answer your query re the grid, you could setup functionality in the grid to be able to select some "reusable" content from the data storage area and so this will render out in the page at run time.
For the grid you would need to setup a new option for a content picker to facilitate the above - I don't have code handy for that, but there is one package I know of that would help - Le Blender. It might be a bit overkill for this requirement, but then again, once you start using it you might be able to use the additional features.
Hope this helps and don't hesitate to shout out if you've any more queries.
Cheers, Nigel
Hi Nigel Thanks for your response! I had to look up that idiom, and no, my egg sucking skills are limited when it comes to umbraco so every advice is welcome :)
Although I know about document types and their templates, partials and macros and from what I understand its not possible to use partials in grids, just macros. What datatype are your stripes? Partials?
I have also looked into grid editors and they seem a bit cumbersome if you want to use server side/.cs code.
Are you telling me that with the LeBlender-plugin I can mix dumb "stripes"
with reusable content? And what are reusable content in this context? any template that contains different data depending on product (in my case)
As I see it I can 1) Create a bunch of macros, one for each graphical element then create 3 instances/pages of a "My Grid Page" in umbraco and drag the macros/stripes as a back office-user would do.
2) Create 3 Page Templates and a bunch of partials and render them on the 3 page templates RenderPartial() as below
It should be said that most of the data from this specific pages is read from an external source and not from editors.
is working on a reply...