Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • jbjb 2 posts 22 karma points
    Sep 16, 2024 @ 16:49
    jbjb
    0

    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: enter image description here

  • jbjb 2 posts 22 karma points
    Sep 17, 2024 @ 20:24
    jbjb
    0

    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

  • Marc Love (uSkinned.net) 447 posts 1790 karma points
    Sep 18, 2024 @ 08:18
    Marc Love (uSkinned.net)
    0

    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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies