Atto Text editor - initialization

Atto Text editor - initialization

by bala chandra -
Number of replies: 4

Hello,

I need help to initialize atto editor, I have atto html editor installed, but, it doesnt show up due to other settings and my custom theme, so I have to add atto html editor to the textarea explicitly.

I could do this for tinymce with my script.js file and code:

document.write('<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js" type="text/javascript"></script>');
$(document).ready(function(){tinymce.init({selector:'textarea'});});

But, I am not able figure out how to achieve the same for atto... Any suggestions.


Regards

Balachandra

Average of ratings: -
In reply to bala chandra

Re: Atto Text editor - initialization

by Colin Perepelken -
I've done this when writing an Atto editor plugin. In my editor plugin YUI module, I used:

Y.M.editor_atto.Editor.init(params);

I'm not sure if this can be done outside of a YUI Module, and if this will be helpful to you. However, this is the only way JavaScript way I have seen to initialize the editor. You can debug /lib/editor/atto/lib.php to see which params are required to init Atto.

In reply to Colin Perepelken

Re: Atto Text editor - initialization

by bala chandra -
Hello Colin,

Thanks for your reply...

I want this to be implemented to all the textareas dynamically, and when I checked the editor/atto/lib.php, i found that we have to transfer atleast the ID of the element. In my case, it is unknown. and any other way to do this?? like pass something like this : {selector:'textarea'}

Thanks in advance smile

regards
In reply to bala chandra

Re: Atto Text editor - initialization

by Colin Perepelken -

As far as I know, the ID of the textarea is required. I would recommend taking another look at your custom theme or whatever is causing the Atto editors to not be initialized. That would likely be easier to solve than trying to do what you are now. There are plenty of custom themes, and none that I know of which disrupt the Atto editors functionality. Maybe look at some existing ones and compare them with your theme.

Best of luck, Colin.

In reply to Colin Perepelken

Re: Atto Text editor - initialization

by bala chandra -

Thank you Colin,

Sorry for late reply.

I checked the possible options as per your suggestions, Will check and shall update if I am successful..


Thank you very much