1. 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

Discussion in 'XenForo Development Discussions' started by Veryard, Jan 27, 2015.

  1. Veryard

    Veryard Formerly BradsFX

    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!
     
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    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>
    
     
  3. Veryard

    Veryard Formerly BradsFX

    After I do this, it show's <p>Around the message when submitted</p>
     

Share This Page