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.37k stars 4.05k forks source link

New feature #526

Closed matiponce91 closed 6 years ago

matiponce91 commented 6 years ago

Hi Arthur, I have developed a new feature that is the possibility to add tabs inside blocks panel (this is optional what it means that if you don't add any tab, blocks panel will continue behaving as before) and these tab could have their own categories and blocks. My question is if would be possible to add this feature in core GrapesJs due to I had to develop a brand new manager called TabManager. In case it would be only possible to add as a plugin, how can I add this new manager?

The idea is that doing

tabManager:{
    default : 'content',
    tabs: [{
        id: 'tab1',
        label: 'Tab 1',
        attributes: { class:'gjs-fonts gjs-f-b1' }
    },{
        id: 'tab2',
        label: 'Tab 2',
        attributes: { class:'gjs-fonts gjs-f-b1' }
    }]
}

And adding the tab id inside block definition as below:

label: 'Block',
category: 'Basic',
tab: 'tab1',
attributes: { class:'gjs-fonts gjs-f-b1' },
content: `<div style="padding-top:50px; padding-bottom:50px; text-align:center">Test block</div>`

We get the following result: captura de pantalla 2017-11-15 a la s 10 47 16

If we switch to the other tab you can see the result: captura de pantalla 2017-11-15 a la s 10 56 11

artf commented 6 years ago

Just check here https://github.com/artf/grapesjs/issues/499 :)

lock[bot] commented 5 years ago

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.