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

Add Redactor to my addon's textarea

Veryard

Formerly BradsFX
#1
Hello, I am working on a small addon, I am just wondering how would I be able to add redactor to my textarea for my addon?

Thanks!
 

Jeremy

Well-known member
#2
You fetch it in your view class:
PHP:
<?php

class Dentel_Testimonials_ViewPublic_MyView extends XenForo_ViewPublic_Base
{
    public function renderHtml()
    {
        $this->_params['editorTemplate'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate(
            $this, 'message', $this->_params['defaultMessage']
        );
    }
}
And then in the template:
HTML:
    <fieldset>
        <dl class="ctrlUnit fullWidth surplusLabel">
            <dt><label for="ctrl_message">Message:</label></dt>
            <dd>{xen:raw $editorTemplate}</dd>
        </dl>
    </fieldset>