Copied to clipboard

Flag this post as spam?

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


  • Sean Håkansson 68 posts 204 karma points
    Aug 16, 2024 @ 14:54
    Sean HÃ¥kansson
    0

    Umbraco 14 - Umbraco UI: How to build a custom property extension with pickers?

    Hi, have anyone tried building extensions with the new Umbraco UI?

    I'm trying out the new UI lib, lit etc and playing around with a demo, and I would like to try to add some pickers for media and multi-node content picking.

    Does anyone have any examples, or maybe some hints on what I should look into? I'm guessing I have to dispatch some sort of event, and listen to the returned values.

    Thanks!

  • Bishal Tim 26 posts 135 karma points c-trib
    Sep 03, 2024 @ 20:50
    Bishal Tim
    100

    Hey sean,

    for media:

    import type { UmbInputMediaElement } from '@umbraco-cms/backoffice/media';

    property as: media: string = "";

    event handler:

    #onChange(event: CustomEvent & { target: UmbInputMediaElement }) { this.media = event.target.selection?.join(',') ?? null; this.dispatchEvent(new UmbPropertyValueChangeEvent()); }

    <div class="flex-container">
                                <label class="description">Image for the page</label>
                                <umb-input-media
                                    .min=${this.#min}
                .max=${this.#max}
                                    @change=${this.#onChange}>
                                </umb-input-media>
                            </div>
    

    i would look at this setup from core as well property-editor-ui-media-entity-picker.element.ts Latest

    , i use it like this to send the data to server from which i save it to my db

  • Sean Håkansson 68 posts 204 karma points
    Jan 21, 2025 @ 08:58
    Sean HÃ¥kansson
    0

    Thanks Tim! I had a long break in discovery for this side project but now I am back trying to finish it up.

    For content pickers I found this. I had previously used

    In general i have had issues when trying to import classes, it seems like many of the property-editors are private?

  • 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