#2820June 10, 2020by Rubark1 answer
Dear artf I'm trying to add feature to my application, for end user. It's a tool for - Dynamically adding CSS and JS CDN-s. Like in jsFiddle or Codepen, when we add external resources(css/js) CDN-s. That means, that after adding a link for js, or css, it will appear in Canvas iFrames head. Unfortunately I couldn't fin...
artf
You if need to save dynamic css/js inside the template you have to append them to the body (eg. editor.addComponents('<script src="...">..')) if you need them outside the template (which manages ONLY the body), like in the <head>, you can...
#2819June 10, 2020by akashdesale981 answer
I have written the following code - const component = editor.getSelected(); component.addTrait({ name: 'traitName', type: 'text', label: 'traitLabel', value: 'traitValue' }); const traits = component.get('traits'); traits.forEach(trait => console.log(trait.props()))
artf
Traits change the component (and its final HTML) when you use them. By simply updating traits collection in the component doesn't make any change to it on the HTML side
#2818June 9, 2020by MarlonV1231 answer
Good afternoon, it will be that this GrapesJS can install a Google Analytics plugin is to be able to monitor each page created with this editor, since it is very complete and I want to continue using it
artf
You have to create a custom component for the purpose https://grapesjs.com/docs/modules/Components.html https://grapesjs.com/docs/modules/Components-js.html
#2817June 8, 2020by rathodrupesha2 answers
Hello Sir, We have used grapesJS for page builder. We have created a page by grapesJS & store on a remote server. Now we want to just show/preview that page in our angular. Kindly give us solution for How to display Readonly grapes js preview in Angular 8?
artf
Just render the HTML/CSS you store on your remote server
wojiaoxiaomayun
hi,I want to dynamically display projectData in the preview interface, just for previewing, without any other functions, including right-clicking and dragging, etc. It's not required, nor is it HTML/CSS
#2816June 8, 2020by scaneNo answers
Hello, I have written a custom GrapesJS component. So what I'm trying to achieve with this custom component is, if I place 2 components of the same type in the GrapesJS canvas and on editing the style of one component through style manager should automatically update the style of the other component. Is there a way to...
#2814June 5, 2020by RJCAM3 answers
Hello and thanks for sharing such a good project. I'm trying to customize some things in the editor but I have some questions that I would appreciate if they could be clarified. Recently I create a panel button to switch editor from absolute and default modes and it's working without any problem. But when I try the sa...
artf
You can change it in this way editor.getConfig().allowScripts = ...
artf
AllowScripts is for enabling parsing of JS, once the script is inserted it's executed, so you can't remove it (one way would be accessing the iframe's context and making changes manually)
RJCAM
Thank you for the response @artf . Here's the problem, the code you give me changes the value but still doesn't work as I described above. In the demo I share (https://codepen.io/RJCAM/pen/xxZbNLw) I have a button that shows an alert when...
#2813June 3, 2020by KaytotheH1 answer
` const blocktext = blockManager.get('text').set({ label: 'Modified text', attributes: { } }) ` I want to add an attribute to the original text block, I want the attribute to give the user the option of giving the component, time to appear and disappear at another time. My question is, what are the attributes that I c...
artf
You can do this editor.Blocks.get('text').set({ attributes: { class: 'my-custom-class' } })
#2812June 1, 2020by BerkeAras2 answers
Hello. In the latest version it is not possible to drag and drop a button. It gives this error: `Invalid target position: Target collection not found, Target is not droppable, accepts [undefined], Component not draggable, acceptable by [undefined]`
RJCAM
@BerkeAras the default button inside the Form category is only droppable inside a form block (the first block inside Form category). All those blocks are allowed to be dropped inside a form only. If you want a button to be dropped inside a...
#2811May 30, 2020by BerkeAras3 answers
Hello. I am getting this error in the console: Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'. What could this be?
BerkeAras
@artf I'm sorry, for my issue. The bug is fixed. The problem was because I tried to remove the settings pane, but there was a typography mistake.
RJCAM
You need to be more specific in what your trying to do and how are you getting this error.
BerkeAras
I don't do anything. If I just place GrapesJS on my page, this happens.
#2810May 30, 2020by BerkeAras2 answers
Hello! Is it possible to make a version for non-developers or people who don't know css basics. I am programming a CMS and most users don't know what position: absolute is, they just want to drag and drop element to a place, where they want.
Ju99ernaut
grapesjs already supports moving components freely, check issue #1936