Is it possible to replace the asset manager with something completely different (such as CKFinder - https://ckeditor.com/ckeditor-4/ckfinder/)? Alternatively, would it be possible to launch the included asset manager outside the context of grapesjs?
artf
Well, never tried it before but I think you can achieve it just by replacing the current command This is how the command is called https://github.com/artf/grapesjs/blob/e921165a8d681b5d1056c816f88dd7719d4f61e0/src/dom_components/view/Compo...
ryandeba
Thanks @artf! I was able to get this working very quickly with your suggestion.
lock[bot]
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.
I have a use case where I would like to make some specific components completely locked down (i.e. not resizable, not draggable, not copyable, not removable, etc). I have this mostly working, but I'm having a problem with images - I cannot seem to prevent the double-click functionality that opens the asset manager mod...
artf
Yeah, you're right, I use editable only for text components, but what you're asking actually make sense. I'd be happy to accept your PR. You should add editable: true, to the model https://github.com/artf/grapesjs/blob/dev/src/domcomponent...
ryandeba
Thanks @artf! Here's the pull request: https://github.com/artf/grapesjs/pull/496
I'm used the html and css editor that mention in #324 . After I edited the html and css it will generate a CSS where I suspect caused by editor.setComponents() Not sure this is a bug or normal behavior. grapesjs version - 0.12.8 grapesjs preset - gjs-preset-newsletter 0.2.15
thecodefish
In my use case I am constantly getting & setting the html/css inside the editor, and what I found is that it would end up duplicating the 'default' styles (see the * and body styles in the image above - they appear twice). I managed to sol...
thecodefish
@chiqui3d I think whenever you need to modify the css from some external source, you'll probably want to reset the css composer first. So if you have something like editor.setStyle(css); in your code, you may need to call editor.CssCompose...
artf
First of all, update your grapesjs version, then be more specific about your changes. What did you change? What do you mean with unwanted css?
below is code i used for traits and custom section but after adding component via block, cannot edit text or trait update does not update canvas. I have extended 'text', Also I do not get html back when I use editor.html(), Also when I click on image it does not open asset manager. I am sure I must be missing somethin...
artf
In your model, you don't need defining data-gjs-* it's only make sense for importing from HTML, so remove this: and you don't need type: 'section', either. From what I see you should define addType like this You can't edit this because it'...
lock[bot]
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.
My intent is to create a block that should allow only image components (I'm using the default one from grapes-blocks-basic) to be dropped inside it. I have the following test code: However, when I run the above code, what happens is that I can't drop an image component inside the Image Container. The green drop cursor...
roytang
This fix works. Thanks!
artf
@roytang your code seems ok, probably the problem is just because your component is "too much empty" so the mouse pointer just can't get in. Try to add a little bit of padding and see if it works
roytang
Mmm. I have image-container styled with width and height 100px. Also, removing the droppable property in the extended model allows me to drop text and images inside it.
I am in process to create custom component for below template and we want to have user enter text,link,hover text and select image and want to use default asset manager to select image but not sure how to get selected image in custom component? below is code I have used view: defaultType.view.extend({ init() { this.li...
artf
@krunal039 Why do you need a custom component? Your template seems to be pretty simple, what about just a simple block?
krunal039
@artf thanks for reply, we need user input for hover text, background image and text and hyperlink at bottom and thought to use custom component, but if we can prompt user to enter above then happy to create just block, can you pease guide...
artf
Try to create a block with your template, drag it inside the canvas and you will be able to change all that stuff
Hello, Is it possible to make two TextBoxes under the same label? If it is possible then how can I create that?\ Thank You.
artf
@HarshOB I don't understand where is the issue. Have you tried just to drag another input?
HarshOB
Yes, I have tried but it won't work. Like I want two text boxes in front of one label like if as shown in below image I want to make two text boxes under the same label "TOKEN"
Hello, So, I want to define Two traits in the component settings. First one is CheckBox and another one is TextBox(There can be multiple). I will define First CheckBox the multiple Input fields. When a CheckBox is clicked/checked on the base Next TextBoxes/input fields (That will be disabled by default) will be Enable...
artf
@HarshOB Did you check already the wiki about Traits? I explain there how to add checkbox inputs and how to react to their changes. If it's not clear can you point me out what should I add?
HarshOB
Here I explain again with a screenshot. You can see that there are two text fields under one checkbox. So, when I clicked on checkbox/ check that checkbox then that two input fields will be enabled(I want it to disable when it loads for th...
artf
No, it's not something you can do with a built-in trait, but you can define your own type (which can even include all your inputs) by extending the default one
For example if I import <p><span style="font-size:50px;">hi</span></p> via grapesjs import command, the following is set as the component: <p data-highlightable="1">hi</p>. Losing my styles
Geczy
You can reproduce on http://grapesjs.com/demo-newsletter-editor.html My issue is described here https://github.com/artf/grapesjs/issues/341 https://github.com/artf/grapesjs/blob/dev/src/parser/model/ParserHtml.js#L145
Geczy
In my case it is preferable to not strip the <span> and leave it in the HTML. Why was it removed? Be careful of things like: What should the expected output be after the parser? Hi should be 50px, hey should be 12px. This is why the html p...
artf
I agree with you Matt, indeed, as already mentioned, I'd like to remove it but need to find time to test it, to be sure it's not breaking other stuff. I close this in favor of #341