[QUESTION] pluginsOpts NOT working - why?
Question
Hey guys,
I am new to grapejs, but so far I really love it! Now I stumbled over a problem that I can't seem to fix or to find a solution anywhere, or I am just too stupid.
I was playing around with my own named plugins and imported them into the grapejs-script. It works fine and the created blocks show up. The only problem is, that my pluginsOpts value get simply ignored. Can anyone tell me why?
Code of the plugin.js:
<script>
function autoMarke(editor){
editor.BlockManager.add('autoMarke', {
label: 'Automarke',
content: '<div class="my-block">autoMarke</div>',
});
}
function autoModell(editor){
editor.BlockManager.add('autoModell', {
label: 'autoModell',
content: '<div class="my-block">autoModell</div>',
});
}
</script>
Codesnap of the index.php:
<script type="text/javascript">
var editor = grapesjs.init({
height: '100%',
noticeOnUnload: 0,
storageManager:{autoload: 0},
container : '#gjs',
fromElement: true,
plugins: ['gjs-blocks-basic', 'gjs-plugin-ckeditor', 'autoMarke', 'autoModell'],
pluginsOpts: {
'gjs-blocks-basic': {
blocks: ['column1', 'column2', 'column3', 'column3-7', 'text', 'link', 'image']
},
'gjs-plugin-ckeditor': {
language: 'de'
},
'autoMarke': {
category: 'Platzhalter',
className: 'fa fa-car'
},
'autoModell': {
category: 'Platzhalter',
className: 'fa fa-car'
}
}
}); </script>
Thanks for any help in advance!
Answers (3)
Can you create a reproducible demo, please? From your examples, I can even say "you don't have options in your plugins", so can't help you without a demo. Next time, if something is not working please follow the BUG issue template, not the QUESTION one
Can you create a reproducible demo, please? From your examples, I can even say "you don't have options in your plugins", so can't help you without a demo. Next time, if something is not working please follow the BUG issue template, not the QUESTION one
Hey there, thanks for your answer!
I am talking about the "category" fields that won't be listed in the Frontend, it just appears under the basics. That's basically the only "option" that I need. But it seems it won't work this way.
@untouch68 again, your examples are incomplete, can you create a reproducible demo?
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2906
BUG: editor.refresh() not working in custom setup
I have a problem with a custom setup where the canvas iframe is moved around with js. The "editor.refresh()" call does not fix the position...
Issue #1123
[QUESTION] Onload event inside template
Hi! I have a problem with some templates. This template has some scripts running after the page is loaded. When this templates is loaded by...
Issue #3230
BUG: Modal won't open after closing it dynamically
Hello; Thank you guys for the great tool, I just love the documentation, the easy to use/understand. I think I ran into an issue with the m...
Issue #3389
MultiSelect some elements and change styles only work on the last selected element
Hi, when I MultiSelect some elements using shift, and change style in styleManager. Only the last clicked element will update the style. Ca...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.