Issue #2146Opened July 17, 2019by untouch680 reactions

[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)

artfJuly 25, 20190 reactions

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

untouch68July 29, 20190 reactions

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.

artfJuly 31, 20190 reactions

@untouch68 again, your examples are incomplete, can you create a reproducible demo?

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.