Adding a button to Atto

Adding a button to Atto

by Henry Zektser -
Number of replies: 1

I've been trying to use the Atto plugin template (https://github.com/justinhunt/moodle-atto_newtemplate) to try and create my own Atto plugin. I've made the changes outlined in the README, and ran shifter to create the build folder with 3 js files in it.

As far as I can tell, my structure matches every other plugin in lib/editor/atto/plugins.

I'm able to see the plugin in configuration, and it's showing up in the Atto Toolbar Settings, but, when I pop open a text editor, I don't get an icon, and the console logs moodle-editor_atto-editor: Plugin 'testplugin' could not be found - skipping initialisation

Has anyone come across this before? What am I missing?


Average of ratings: -
In reply to Henry Zektser

Re: Adding a button to Atto

by lior gil -
Picture of Core developers

Hard to answer without looking at the code, but here are some thoughts.

Go to moodle-editor_atto-editor file and look at the setupPlugins function. Here you will find the reason for this log, when the editor cannot find a registered plugin named - in your case - 'atto_testplugin'.

Look at your plugin code and make sure its initialization starts with Y.namespace('M.atto_testplugin').Button (case sensitive of course).