• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Create instance of RTE?

Liam W

Well-known member
#1
I don't know which one would be easier (RTE would be better).

How would I add a RTE instance to a custom addon page?

Is there a tutorial somewhere?

Liam
 
#3
*does not know what RTE is*
Rich Text Editor

------------------------------

You can get the editor HTML in your view through a helper
Code:
$this->_params['editorTemplate'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate(
	$this, 'some_name', 'Initial content'
);
The parameters are:
1) The view calling the function ( eg. $this )
2) The name of the editor ( for the form )
3) (Optional) The initial content ( Usually something from $this->_params )

To put it in your template:
Code:
{xen:raw $editorTemplate}
To retrieve the input in the controller when saving:
Code:
$var = $this->getHelper( 'Editor' )->getMessageText( 'some_name', $this->_input );
 

Liam W

Well-known member
#4
Rich Text Editor

------------------------------

You can get the editor HTML in your view through a helper
Code:
$this->_params['editorTemplate'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate(
$this, 'some_name', 'Initial content'
);
The parameters are:
1) The view calling the function ( eg. $this )
2) The name of the editor ( for the form )
3) (Optional) The initial content ( Usually something from $this->_params )

To put it in your template:
Code:
{xen:raw $editorTemplate}
To retrieve the input in the controller when saving:
Code:
$var = $this->getHelper( 'Editor' )->getMessageText( 'some_name', $this->_input );

Thanks :D
 

Liam W

Well-known member
#5
Rich Text Editor

------------------------------

You can get the editor HTML in your view through a helper
Code:
$this->_params['editorTemplate'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate(
$this, 'some_name', 'Initial content'
);
The parameters are:
1) The view calling the function ( eg. $this )
2) The name of the editor ( for the form )
3) (Optional) The initial content ( Usually something from $this->_params )

To put it in your template:
Code:
{xen:raw $editorTemplate}
To retrieve the input in the controller when saving:
Code:
$var = $this->getHelper( 'Editor' )->getMessageText( 'some_name', $this->_input );

How do I convert BBCode to HTML?