@Jeremy P I get the editor to show in the template. But I get this error message when hitting submit:HTML:<xf:editorrow name="some_input" value="{$someValue}" rowtype="fullWidth noLabel" label="{{ phrase('some_label') }}" explain="{{ phrase('some_explainer') }}" />
Oops! We ran into some problems.
Please enter a value for the required field 'message'.
@Jeremy P Here is my Entity file: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.
How are you saving the values from the form to the entity?
?
Here is the controller:You will need a controller action to capture the form submission and create a new entity.
<?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.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 });
Does this look correct?It'll be thename
attribute of your editor row in your template.
some_input
, so you'll need to use that:$message = $editorPlugin->fromInput('some_input');
message
in the $input
array.That was it. Much appreciation for taking the time to help me through this. Still learning.You need to return the form action from the save process.
We use essential cookies to make this site work, and optional cookies to enhance your experience.