$editor = JFactory::getEditor();
echo $editor->display( 'some[name]', '', '100%' , '20%' , '100' , '10' );
The WYSIWYG TinyMCE editor shows up.
<textarea>
shows up, clicking on Toggle Editor will turn it into the WYSIWYG editor.
Joomla! 3.6.0
Found the resolution, will provide a PR as soon as possible.
Worked before. Also, the $id
is optional so why not clean it before using it? It shouldn't take more than a couple of lines.
There was a change in tinMCE (joomla side): before the selector for tinMCE was a class .mce-editable
and now is using the id, check plugins/editors/tinymce/tinymce.php line 834
So, if code worked correctly on previous versions of Joomla!, then this is a B/C break. There's obviously a small oversight, because there is some filtering done to the $id
but that variable never gets used.
The issue is NOT with TinyMCE, but with its initialization, because HTML ids are not sanitized. It's a small fix which I'll provide in a little while.
NO! the code before was crap for multiple instances of tinyMCE in the same page, that was fixed with this change
I just love endless discussions without any arguments :)
try this:
if (empty($id))
{
$id = $name;
$id = str_replace('[', '__', $name);
$id = str_repeat(']', '', $id);
}
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-07-19 09:30:37 |
Closed_By | ⇒ | brianteeman |
Closed as we have a PR for testing
Labels |
Added:
?
|
@OctavianC your code will not work, let me explain:
tinymce display needs an id:
(plugins/editors/tinymce/tinymce.php:121)
public function onDisplay($name, $content, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null)
If non is given then this code will be executed:
(plugins/editors/tinymce/tinymce.php:123)
and obviously an id with brackets won't be accepted