Adding a WYSIWYG editor to our component backend
At the moment, in our component's backend, when adding or editing a new element, we have a simple textarea to do it. We enhanced this textarea to grow, as needed, when text was entered in it. But, what if we want to do something more with it, such as adding images, links, bold text, and so on?
For this we could use a WYSIWYG editor. WYSIWYG stands for What You See Is What You Get, and if you have been using Joomla!, you surely will have seen one.
We can add a jQuery editor plugin, much in the same way that we added the textarea autogrow script. However, this is quite easy, and I think it would be more interesting to see how to use Joomla!'s editor.
First, open the
administrator/components/com_tinynews/views/addnews/tmpl/form.php
file. In this file, we will remove the simpleautogrow plugin because it won't
work together with the WYSIWYG editor. Remove the next piece of code, except for the
highlighted line, which is still needed:
$js = JURI:...