How to open asset selector from custom Bard extension? #9254
Replies: 2 comments 2 replies
-
Hey 👋 Your best bet would be to source dive the Image button that's built into Bard and try to copy it to work for your use case. For example: here's where the Image button shows the asset selector and the asset editor: https://github.com/statamic/cms/blob/4.x/resources/js/components/fieldtypes/bard/Image.vue#L47-L69 You probably want to copy it and wire up its required props and events. |
Beta Was this translation helpful? Give feedback.
-
Thanks, but I was looking for a pure JS solution, because there is no Vue component involved. Our goal is to add support for inline attributes. Just added a new button using the TipTap Image extension and prompt for an URL like the example provided. Replacing the If there's no way to do it using JS API, we will create a Vue component as you suggest... |
Beta Was this translation helpful? Give feedback.
-
We are trying to add a custom button to Bard editor that need to select an asset from asset selector. Is there a way to call it from JavaScript and return the asset path?. Just like the Image button does...
Beta Was this translation helpful? Give feedback.
All reactions