XF 2.3 Add the editor to a template

HTML:
<xf:editorrow name="some_input" value="{$someValue}"
    rowtype="fullWidth noLabel"
    label="{{ phrase('some_label') }}"
    explain="{{ phrase('some_explainer') }}" />
 
HTML:
<xf:editorrow name="some_input" value="{$someValue}"
    rowtype="fullWidth noLabel"
    label="{{ phrase('some_label') }}"
    explain="{{ phrase('some_explainer') }}" />
@Jeremy P I get the editor to show in the template. But I get this error message when hitting submit:
Code:
Oops! We ran into some problems.
Please enter a value for the required field 'message'.

What required field is it looking for?

Thanks,
CipherX
 
It usually means you haven't set a required value on an entity, but that's dependent on the backend code and not anything to do with the template itself.
 
It usually means you haven't set a required value on an entity, but that's dependent on the backend code and not anything to do with the template itself.
@Jeremy P Here is my Entity file:
Code:

The message is set to required. Any help would be much appreciated.

Thank,
CipherX
 
Last edited:
You will need a controller action to capture the form submission and create a new entity.
 
In your save process, you will need to capture the editor input with the editor plugin and set it in a setup callback. Something like this:

PHP:
$editorPlugin = $this->plugin(\XF\ControllerPlugin\EditorPlugin::class);
$message = $editorPlugin->fromInput('your_input_name');

$form->setup(function () use ($note, $message)
{
    $note->message = $message
});
 
In your save process, you will need to capture the editor input with the editor plugin and set it in a setup callback. Something like this:

PHP:
$editorPlugin = $this->plugin(\XF\ControllerPlugin\EditorPlugin::class);
$message = $editorPlugin->fromInput('your_input_name');

$form->setup(function () use ($note, $message)
{
    $note->message = $message
});
@Jeremy P I tried several different options for 'your input name' and none of them worked. At a loss.

Thanks,
CipherX
 
In your template, if you copied my code directly, the name was some_input, so you'll need to use that:

PHP:
$message = $editorPlugin->fromInput('some_input');

You also don't need to capture the message in the $input array.

Beyond that, I don't know what you mean by it doesn't like something. I don’t know what that code snippet is supposed to do, or why. You'll need to post the expected result, actual result, and any error messages or stack traces.
 
Last edited:
Here is the error message:

Code:

This is line 68
Code:
 $this->noteSaveProcess($note)->run();
 
Last edited:
@Jeremy P When using the editor to change the color of the text I get this output form the editor:

Screenshot 2025-03-27 230349.webp

Is there another step to include in the controller for it to spit out the text in color?

Thanks,
CipherX
 
Back
Top Bottom