XF 1.5 Change textarea to RichText editor

PeterChen

Member
Hi. I want to modify text area in Profile Post to Rich text Editor

f257670ad3f7f8cb5a3c20fb7be0fb5e.png


I Edit file \library\XenForo\ViewPublic\Member\view.php

Code:
<?php

class XenForo_ViewPublic_Member_View extends XenForo_ViewPublic_Base
{
    public function renderHtml()
    {
      
        $this->_params['advappheaderTemplate'] = XenForo_ViewPublic_Helper_Editor::getEditorTemplate(
        $this, 'message', '',
        array('templateName' => 'advapp_wysiwyg')
        );
    }
}

and edit template member_view
HTML:
                        <div class="messageInfo">
                            <!-- OLD CODE -->
                            <!--<xen:if is="{$visitor.user_id} == {$user.user_id}">
                                <textarea name="message" class="textCtrl StatusEditor UserTagger Elastic" placeholder="{xen:phrase update_your_status}..." rows="3" cols="50" data-statusEditorCounter="#statusEditorCounter"></textarea>
                            <xen:else />
                                <textarea name="message" class="textCtrl UserTagger Elastic" placeholder="{xen:phrase write_something}..." rows="3" cols="50"></textarea>
                            </xen:if>-->
                            <!-- MY CODE -->
                            {xen:raw $advappheaderTemplate}
                            <div class="submitUnit">
                                <span id="statusEditorCounter" title="{xen:phrase characters_remaining}"></span>
                                <input type="submit" class="button primary" value="{xen:phrase post_verb}" accesskey="s" />
                                <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
                            </div>
                        </div>

But it do not display anything

I do the same thing with personal detail , it display the rich text editor. I cannot explain why the profile post is not display
af2f607bf3c67244e7592f95f6079daa.png


Help me
 
Last edited:
Just a warning in case you're expecting it to: Changing that area to the rich text editor won't automatically allow you to use text formatting in profile posts. You'll have to implement BB Code parsing on profile posts for that as well. Also you will have to make adjustments to the actual submit/insert method of the message to reflect this change.
 
Top Bottom