Add second Atto instance

Add second Atto instance

by Hannes von Allwörden -
Number of replies: 3

I am trying to add a second instance of Atto in order to be able to offer different "flavours" of the editor.

The following approach worked fine with a copy of version 2013111800  of the editor obtained from Github, using a bash script:

  1. Copy plugin folder to .../moodle/lib/editor
  2. Rename every occurence of "atto" in folders and filenames
  3. Rename every occurrence of "atto" within files  
  4. Run "grunt shifter"
  5. Install the newly found plugins in the "Site administration" section of the website
However, when I try the same with a copy of version 2019111800 shipped with Moodle 3.8+ (Build: 20191205), the "title" dropdown menu does not work and the width of the editor changes dynamically with the text width:

Screenshot of duplicated Atto editor

It seems that I broke something on the way, but I cannot figure out exactly what ... any ideas? Thank you very much!

Average of ratings: -
In reply to Hannes von Allwörden

Re: Add second Atto instance

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hi,

Talking about having several Atto flavors, you could perhaps look at my previous idea/proposition.

But for sure, it's just an idea, and i don't (and won't) develop anything.

HTH,
Séverin

In reply to Séverin Terrier

Re: Add second Atto instance

by Hannes von Allwörden -
Hi Severin,
thank you very much for the link! I had seen your proposition, and I really like the idea. Currently I am not aiming at this specific functionality, but I believe being able to create different instances of Atto would faciliate implementing it. There was another possibly related discussion here which has been deleted, so there seems to be some interest in that topic.
Best regards,
Hannes
In reply to Hannes von Allwörden

Re: Add second Atto instance

by Hannes von Allwörden -

I ended up with a different solution using the Atto-specific options of the Editor API described here. With these, it is possible to create a tiny plugin that only changes the 'atto:toolbar' part of the options and then uses atto in the use_editor() function. I guess this would also be a relatively simple way to realise what you had in mind, Séverin.

Average of ratings: Useful (1)