2

I need to add some functianality to Joomla's editor. The idea is to add a button to the editor to add a gallery's HTML code. But it seems that I can't change the editor after init.

  • And how are you currently trying to manipulate the editor? Can you please show some code? – Lodder Nov 8 '14 at 11:10
  • I have no idea how to implement such thing. The only way is to replace the core library 'media/editors/tinymce/tinymce.min.js' with my one, but i think it's not a good idea – aspirisen Nov 8 '14 at 11:13
3

I'll make this an answer so I can explain a little better at ease.

Ok so I'm not sure if this is a feature you want to make available to the public or if it's purely for your own benefit, but I would personally approach this a different way. The only efficient way to do this without editing a core Joomla file is to develop a plugin.

So you have 2 choices here.

1:

Develop a plugin that allows you to use short code such as {gallery}{/gallery}, which then automatically generates the HTML for you using a preg_replace.

2:

Develop a plugin that adds a button below the editor (such as the "read more" button). The good thing about this is if you do make this available to the public, then it will work for all editors as you can't be sure that all users will be using the default TinyMCE editor, in which case you button will not appear. You can have a look at:

plugins / editors-xtd / readmore

To see how something like this can be done.

So I've provided you with with the 2 most efficient methods to achieve this. I now suggest you have a read through the Joomla Documentation on Plugin development:

http://docs.joomla.org/Portal:Plugin_Development

If you have any coding related issues when developing it, feel free to ask.

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.