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

Create instance of RTE?

Discussion in 'XenForo Development Discussions' started by Liam W, May 14, 2013.

  1. Liam W

    Liam W Well-Known Member

    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?

  2. tyteen4a03

    tyteen4a03 Well-Known Member

    *does not know what RTE is*
    Jeremy likes this.
  3. Filetrip

    Filetrip Member

    Rich Text Editor


    You can get the editor HTML in your view through a helper
    $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:
    {xen:raw $editorTemplate}
    To retrieve the input in the controller when saving:
    $var = $this->getHelper( 'Editor' )->getMessageText( 'some_name', $this->_input );
    quocuy, Liam W and tyteen4a03 like this.
  4. Liam W

    Liam W Well-Known Member

    Thanks :D
  5. Liam W

    Liam W Well-Known Member

    How do I convert BBCode to HTML?
  6. tyteen4a03

    tyteen4a03 Well-Known Member

    new XenForo_BbCode_Parser()->render($text)

Share This Page