grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Add Setting button to custom component.

Open HarshOB opened this issue 9 years ago • 7 comments

Hello,

How can I create a setting or you can say edit button for my custom component?

LIke 4th option on this image:

screenshotfrom2017-10-1316-01-00

HarshOB avatar Oct 13 '17 10:10 HarshOB

Hi @HarshOB,

It is simple as image does https://github.com/artf/grapesjs/blob/dev/src/dom_components/model/ComponentImage.js#L32

ateshuseyin avatar Oct 13 '17 10:10 ateshuseyin

Hello @ateshuseyin

I don't want the same editor as an image I want to build my own. I just want to add that icon to my component and when I click on that icon I want to display area through the user can add text, image, HTML code etc and that will be reflected in that component.

HarshOB avatar Oct 13 '17 12:10 HarshOB

The above link I referenced before is only for adding button to toolbar. I think you should just follow below steps to complete your task;

  1. Create/Implement a editor according to your needs. grapesjs-aviary uses aviary editor (see)
  2. Define a command which is capable to open your editor like grapesjs-aviary see
  3. Define toolbar button as I referenced before which runs your command

Thats all.

ateshuseyin avatar Oct 13 '17 12:10 ateshuseyin

@HarshOB Create your Component (or extend one) and add your toolbar buttons (as suggested by @ateshuseyin)

artf avatar Oct 13 '17 13:10 artf

Hi @HarshOB,

It is simple as image does https://github.com/artf/grapesjs/blob/dev/src/dom_components/model/ComponentImage.js#L32

Can you please guide me on how this can be incorporated in a grapesjs-preset-webpage, I am unable to get the desired result while using this code in my project.

sakshigarg9 avatar Mar 05 '19 10:03 sakshigarg9

@sakshigarg9 https://github.com/artf/grapesjs/issues/266#issuecomment-470329181

artf avatar Mar 07 '19 00:03 artf

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.

lock[bot] avatar Mar 10 '20 20:03 lock[bot]