@artf thanks for amazing project, it mad site editing much easier. by default editor convert inline css to class but is there setting not to convert inline css to class as we do not want to convert it to class?
artf
If you grep forceClass you will see that it does just one thing https://github.com/artf/grapesjs/blob/dev/src/dom_components/model/Components.js#L77 so when you add a new component and there is a not empty style attribute, all its properti...
artf
Have you tried with forceClass?
francesca-cicileo
I am also looking to do the same thing, but setting forceClass to false does not seem to work. I made a minimal JSFiddle here that tries to use inline css instead of classes, but the editor always moves the styling into classes, even with...
How to add the custom button while adding a new sector in grapesJS? Is there any property? How should I create a button while making new sector. Thanks
artf
@NorthstarTech what is your use case with a button?
NorthstarTech
It doesn't need to be a button specifically. We want to add the merge tags/placeholders. Since we offer a large library of them, it would be user-friendly to have inside a sector. Essentially, we would like the placeholders to divided into...
NorthstarTech
#287 is similar but we are unsure where they are adding the merge tags within the editor.
Hello @artf I have recently started using grapeJs and found it awesome. Can you please help me on How can I add dropdown(select) with optgroup inside trait. Or is there any custom option available like 'html' where I can add my own html traits: [{ label: 'PartialName', name: 'selectPartial', type: 'select', changeProp...
artf
Hi @mohit5540, you have to define a new Trait if you want custom stuff
mohit5540
@artf yes, I created custom trait and it worked. Thanks.
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.
Hello, My installation of GJS ties in all of the default blocks. Every block drags fine onto the page with the exception of all the "columns". i.e: 1,2, and 3 columns. When I drag them.. it does nothing. What should I do? Brandon
brandonburr86
Okay I'll get that working and do a PR
brandonburr86
I see in the inspector that the "row" css class is non-existent. I checked the demo and see that the "row" css class is put in dynamically into the "gjs-css-rules" block.
artf
@brandonburr86 about what demo are you talking about?
In lieu of #540, I'm trying to manually remove a button from the options panel, with this: This works ok, the button goes away, but the pnm.render() seems to break the style manager, in that it becomes unresponsive. Non of the other stuff seems to break, just the styling. Is this a problem I'm introducing or a bug? Th...
duskhacker
It occurs to me that I can just hide the button with some CSS, which is what I've done. I'm still curious about the render though.
sbarfurth
This should be high priority, makes modifying panels after the first render impossible.
artf
I'm closing this as we've removed render method from the public Panel API, it should be executed only on init by the editor. In addition, now you can remove buttons easily by doing this panelManager.removeButton('panelId', 'buttonId')
I must be missing something, but when I change an image, the localstorage html isn't updating, however, changing the text does. So when I refresh the page after changing an image and text, the text remains, but the image not. Is there a setting I need to change to make the localstorage html update the image src?
artf
Thanks for the catch @kickbk, actually src was not listened. The fix will be available in the next release
jmrgz
Hi @artf This is not working in the current demo (neither on my side). If you change any image and reload the page, the image goes to it's previous src. It's not working the first time you load a template. If you add new images in the curr...
jmrgz
I had to solve this using a workaround and it seems like a good solution at the moment. I have created my own localstorage and I'm saving the template on $(window).on('unload... and loading it again on $(window).on('load'
When I click the component, I want the traits to open Clicking a component opens the styles. Clicking it one more time will finally open open-tm the traits manager. How do I override opening styles on click?
artf
Hey Matt, probably you're using the code from the demo and therefore you're conflicting with this https://github.com/artf/grapesjs/blob/gh-pages/js/grapesjs-preset-webpage.js#L257-L268 just try to remove that part
Geczy
Good thinking, thanks ! Overwrote it in .init before render
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.
Im using storageManager remote but the site has csrf token beforeSend: function (t) { var token = $('meta[name="csrf_token"]').attr('content'); if (token) { return t.setRequestHeader('X-CSRF-TOKEN', token); } }, Gives an error "Uncaught TypeError: Cannot read property 'setRequestHeader' of undefined" obviously because...
michaellwatson
Instead of beforeSend, use the headers like this headers:{'X-CSRF-TOKEN':'foo'},
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.
For example, Block for 2 Columns and 2 Columns 3/7 's font awesome and label are not aligned
artf
If you're creating your editor you can easily tweak some CSS (eg. change the font size of blocks), don't see this as something to "fix" at the core level
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.
Hello, I want to add a new section in view container. Lets say, when we click Style manager it opens style manager. I want to create similar behaviour. Need to show some pre-defined templates which should be shown under that section. Can you please help me out?
artf
To add more buttons there Then create yourCommand Command, which might be very similar to https://github.com/artf/grapesjs/blob/dev/src/commands/view/OpenBlocks.js
Amir2828
Hey did you manage to create that new templates view? If so I would like some pointers as I try to do something similar
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.