GrapesJS / grapesjs

Free and Open source Web Builder Framework. Next generation tool for building templates without coding
https://grapesjs.com
BSD 3-Clause "New" or "Revised" License
22.36k stars 4.05k forks source link

Modal template #3367

Closed kerryj89 closed 3 years ago

kerryj89 commented 3 years ago

Is there a way for me to modify the template from a compiled state?

https://github.com/artf/grapesjs/blob/d3256e621bb43a537213ffcd86b10dc0bd070c0b/src/modal_dialog/view/ModalView.js#L1-L16

If not, what would be the cleanest way to insert title and content into a modal skeleton from our CMS for a tighter look and feel? I realize by doing that it would lose grapesjs modal open close events.

Ju99ernaut commented 3 years ago

Here's a list of plugins that use the built in modals, hopefully they're helpful: https://github.com/artf/grapesjs-tui-image-editor https://github.com/artf/grapesjs-custom-code https://github.com/Ju99ernaut/grapesjs-template-manager https://github.com/Ju99ernaut/grapesjs-script-editor https://github.com/Ju99ernaut/grapesjs-blockly

kerryj89 commented 3 years ago

Thanks, but I was looking for a way to inject the content into my own modal. A lot of libraries have a modal template file or variable to do this.

artf commented 3 years ago

Unfortunately, there is no such an option but I'd be happy to accept a PR for such a case :)

artf commented 3 years ago

Now it's possible to replace the modal https://grapesjs.com/docs/modules/Modal.html#custom-modal