How exactly do I make the RTE field appear in my channel forms template pages?
It appears fine in the control panel, but on my frontend, all I get is a simple text box.
Is there some EE variable I need to use in my HTML text area field, or a specific CSS I need to apply to my template to make it appear?
Running latest EE version 6.1.6
Sure. In Slack I was told to use this
{field:my_rte_field_name}
This works! Finally, I see an RTE editor. The RTE loads, but it does with its own HTML and classes in the page. I need to apply my own settings to the text area field.
My text area is the following code right now inside my channel form template page:
<textarea maxlength="5000" rows="8" class="form-control bg-color-primary text-3 h-auto py-2" name="my_rte_field_name" id="my_rte_field_name" required=""></textarea>
I already tried that, the code that is generated by the {field:my_rte_field_name} seems to be dynamic with ID’s generated on the fly, its a very long code with tons of EE unique settings.
If you just copy that HTML code and try to insert it manually on a template, it will not work.
What I need is to add parameters to the RTE text field. When you use {field:my_rte_field_name} on your template, the RTE box is loaded. Works. But my question would be, how do I add specific parameters to this text area. For example, maxlength=”5000” rows=”8”
Since this is inserted on the fly, I should be passing the parameters somehow.
I had the impression that you just code the textarea field manually and then pass a parameter to it to make it an RTE, this does not seem to be the case but the opposite.
How do I customize the RTE field that is loaded on a template with my own rules?
You load the field on a template {field:my_rte_field_name}
It works. But this code is not anywhere on my template. It’s generated by Expression Engine. How can I make it bigger, or limit the characters, or apply extra rules.
This is how my HTML code looks inside the template and channel form.
Note: ee-custom-field is the RTE field I created in Expression Engine for the channel. This works. I can submit the channel entry from the page fine. What I require is to make this an RTE field because it’s not properly formatting text. It’s a simple box without no formatting.
<div class="row">
<div class="form-group col">
<label class="form-label">Message</label>
<textarea maxlength="5000" rows="8" class="form-control bg-color-primary text-3 h-auto py-2" name="ee-custom-field" id="ee-custom-field" required="" placeholder="Enter message here"></textarea>
</div>
</div>
If I use {field:ee-custom-field} in the template the RTE text area is loaded. But I have no control on the formatting.
I’ve been running into the same issue with RTE fields. Today I needed to set a maxlength parameter and was finally able to do so via this parameter: https://docs.expressionengine.com/latest/channels/channel-form/overview.html#rulesmy_field_name
However, it’s not an ideal solution. I’d much rather use my own instantaneous inline validation, (that I’m using for other fields), than have the user decipher error messages on the next page.
I ran into this the other day, too, with trying to make an RTE field required.
I know EE has it’s own error_handling=”inline” option, but I’d rather be able to just customize the native RTE form fields than have to make all my other fields match the EE system here.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.