I have a API rest that receives and supplies the contents of the editor items. The entire store created by the editor is saved: assets, components, css, ... Each item is accessible via route (eg editor / page / 4), when loading the route API returns to the content of the item, however when calling the action editor.st...
artf
If for content you mean html/css, probably you're looking for editor.setComponents('<div>...')
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.
Hi @artf, As you describe before in #26, multi language support is possible using configuration. But there is some static texts in the project. For example https://github.com/artf/grapesjs/blob/88c262be2409734b276d2c22b1f7080ea8359ba1/src/trait_manager/model/TraitFactory.js#L30
artf
π I'll update for the next release
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 all the categories listed in Blocks, must be initially in collapsed condition when the Grapes JS Editor is loaded. How can I do that? Also, if any one category is clicked, all others gets closed just like accordion. Is this possible? Thanks!
artf
Try with this
fzs1994
Wow man, Thanks a lot! Sneak Peak: :heart_eyes:
faizansaiyed
Give your custom class and set styles with the background image Eg Code: In bm.add block and in CSS
I am calling a function which is outside the component same as explained in issue #395 but it is returning a string instead of a function I want to call defaults.drawGauge function in script and pass the id that is created dynamically I am stuck please help me out grapesjs.plugins.add('liquid-gauge-plugin', function(e...
artf
If you want a function attached inside the string you have to pass a string
suchithmahadi
Sorry @artf i didn't understood what exactly you are saying, can you please elaborate? Here i want to call the function ("drawGauge" which is in 3rd line) in domComponents script function. Please explain related to the problem given above....
artf
Inside your script property, {[ d ]} will be replaced with a d property of the componet and it can't be a function, so if your final result should be like this: you have to set a string for d
Hello, First of all, thanks for contributing such an amazing js framework. I am very new to grapesjs. And github too. https://github.com/artf/grapesjs/wiki/Components-&-JS#template-related According to grapesjs wiki, I load js links inside the canvas as the above codes and it works fine. But when I try with css links...
artf
You were almost there :)
ronaldaug
Thank you so much @artf , it works like a charm.
coder-strange
You have to include separately while rendering, it won't come in getHtml() or anything.
We want to define a custom component that may or may not be added into the HTML, but we want to disallow adding more than one of that component. Can this restriction be done in GrapesJS?
artf
Not something built-in, but definitely achievable by using the GrapesJS's API Extremely easy would be adding a listener (eg, change:changesCount), search your component and then apply your logic
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.
We want to create some custom components whose style changes according to an external theme css (there can be different themes), and we want those styles to appear in the canvas while editing.
roytang
Please ignore. I ended up injecting the stylesheet link using javascript into Grapes' canvas' iframe // insert external stylesheet into the grapesjs window var iframes = Utilities_GetElementsByClass("gjs-frame", "IFRAME", document.body); f...
artf
You can inject scripts/styles via canvas config option
Due to https://github.com/artf/grapesjs/issues/436, I cannot rely on StorageManager's Remote Load method to load a template from a REST endpoint, so I'm falling back to alternatives as editor.setComponents() and editor.setStyle() (being used within a command, so grapesjs and editor are available). Unfortunately, those...
artf
Hi @santiph well, if the problem is onbeforeunload you can disable it with noticeOnUnload
santiph
Hi @artf I need to warn the user know of any unsaved changes consistently. And skip it when there's nothing new to be saved: When a new empty template is created, right after saving or right after loading a template, no confirmation messag...
santiph
I could test it with remote storage fully: onbeforeunload is disabled, as expected, on closing right after saving. Unfortunately, it's still being displayed on closing right after loading a new template. After a little debugging, loading a...
I use jquery in my project. After version 0.12.8 it does not work with jquery. Prt of my webpack.config is; When I try to drop a block it throws;ComponentsView.js:76 Uncaught TypeError: Cannot read property 'length' of undefined at child.addToCollection (ComponentsView.js:76) at child.addTo (ComponentsView.js:22) at t...
artf
Do you get the same error with all of your blocks? Even with some official one?
ateshuseyin
Right. I get the same error with all blocks defined in mjml plugin.
artf
Ok, I'd like to understand if it's something related to jquery. Are you able to reproduce it without the mjml plugin? (latest version)