I'm trying to determine how best to implement some kind of reusable component or widget or macro, I don't know exactly what it is within Umbraco I should be using.
What I want is to create something like an "Information Card" that is a widget/component/element. It should have properties like "Title (text)", "Image (which is an actual media file)", "Body (text)"
So a person can grab this widget/component/element/macro, add it to their page/template, and they are required to fill in the 3 properties (title, image and body), and a partial associated with the widget would render a nicely formatted table showing the 3 pieces of data.
I just don't really understand what this concept would be within umbraco...
Noone replied but I will answer my own question:
View Components is the functionality I was looking for. Something reusable with its own template/cshtml markup - that can be different for each page with minimal implementation on each page. More here:
https://www.youtube.com/watch?v=AjCzbilCLHI
I would recommend looking into the Block List and Block Grid property editors. These allow you to add your components like your Information Card example to any page you wish and allow for flexible layouts where other components can be added to a page in the order or layout you wish:
Best practice for reusable components or widgets
I'm trying to determine how best to implement some kind of reusable component or widget or macro, I don't know exactly what it is within Umbraco I should be using.
What I want is to create something like an "Information Card" that is a widget/component/element. It should have properties like "Title (text)", "Image (which is an actual media file)", "Body (text)"
So a person can grab this widget/component/element/macro, add it to their page/template, and they are required to fill in the 3 properties (title, image and body), and a partial associated with the widget would render a nicely formatted table showing the 3 pieces of data.
I just don't really understand what this concept would be within umbraco...
The output would render something like this:
Noone replied but I will answer my own question: View Components is the functionality I was looking for. Something reusable with its own template/cshtml markup - that can be different for each page with minimal implementation on each page. More here: https://www.youtube.com/watch?v=AjCzbilCLHI
Hi Jbjb,
I would recommend looking into the Block List and Block Grid property editors. These allow you to add your components like your Information Card example to any page you wish and allow for flexible layouts where other components can be added to a page in the order or layout you wish:
https://docs.umbraco.com/umbraco-cms/v/13.latest-lts/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-list-editor
https://docs.umbraco.com/umbraco-cms/v/13.latest-lts/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/block-editor/block-grid-editor
Cheers,
Marc
is working on a reply...