WYSIWYG Editor for Frontend Fields

I would like to extend the Rainlab User plugin to add a profile text field.

Now I wonder what the best way to deliver a WYSIWYG Editor to the user.

I checked the plugins, but the plugins delivering an editor seem to do this for backend things like creating pages in the frontend.

In my case, I would display this editor for a certain field stored on the Rainlab User in the frontend.

I’m not sure how to implement this best.

I guess I would need some kind of WYSIWYG Editor Framework / Library and just deliver the content to it.

Still… I would be very grateful on any kind of tips on how to implement this editor.

Like a rough concept or so.

Thanks already :slight_smile:

Hi @LordRazen ,

Using an external library could definitely work, but OctoberCMS already has a built-in WYSIWYG editor you might be able to use instead.

Take a look at this file:

modules\backend\formwidgets\richeditor\assets\js\richeditor.js

/*
 * Rich text editor form field control (WYSIWYG)
 *
 * Data attributes:
 * - data-control="richeditor" - enables the rich editor plugin
 *
 * JavaScript API:
 * $('textarea').richEditor()
 *
 * Dependencies:
 * - Froala Editor (froala_editor.js)
 */
+(function($) {
    'use strict';
    var Base = $.oc.foundation.base,
        BaseProto = Base.prototype;

Here are some recommended editors:

1 Like