Add new views and new content
Hi, i'm back for some question haha, So i wanted to create a new views and add some information example "The name of the file that you gonna download at the "Export" " That can be change by a form in the "Views" .. so i created a new one but i don't know in the src "i'm using the grapejs - preset newsletter notice this", how to add some line and content in my new "Views named : "EDITOR" so i want to do something like this see the picture : https://image.noelshack.com/fichiers/2017/36/1/1504517384-screenshot-at-sept-04-11-27-11.png
Thanks, for my second question i wanted to do something while you drag something from the BlockManager, i wanted to create something like a modal when you drag a special block from the BlockManager example a block named "Product" and after draged it , open a gui like the gui of "Picture" to add an input like Enter the ref of the product and i will use some var to, replace the good name and price of an object in html by a ref. thanks again !
For the Panel, I'd just add the content once the editor is loaded
const content = document.querySelector('#your-content');
editor.on('load', () => {
document.querySelector('.your-custom-panel'). appendChild(content);
})
Check out #174 to see how to setup commands on drop
What type of content did u need to add to add some : button or input ?
Just add whatever content/input/button you want...
Haha, i know sorry you misunderstand me, can u give me a sample of code to add some button or input i try something with document.querySelector('') , don't understand why it does'nt work :x
<div id="your-content">
Input: <input/>
...
<button>Button</button>
<!-- eg. bind a click event on button and do something with GrapesJS API -->
</div>
const content = document.querySelector('#your-content');
Oh thanks a lot did you know where i need to place the html part ? in the index or i can place it on my main.js ?
You can place it in index
When i place the html part in the index it display in the front part did i need to use style: hidden ? Thanks a lot for your answers 👍
https://image.noelshack.com/fichiers/2017/36/3/1504701299-screenshot-at-sept-06-14-34-34.png Its automaticaly display and not in the view part (You can see the screenshot)
My index code https://codeshare.io/aV3zOR
You have to append it
const content = document.querySelector('#your-content');
editor.on('load', () => {
document.querySelector('.your-custom-panel'). appendChild(content);
})
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.