Rich text in controlpanel [SOLVED, kind of]

Also, when I export the registry, I get:

2024-05-23 10:33:07,108 WARNING [GenericSetup.plone.app.registry:98][waitress-1] Field type myproduct.my_control_panel.controlpanel.RichTextFieldRegistry specified for record myproduct.my_control_panel.controlpanel.myrichfield cannot be exported

but I think it is due to the fact that it is not a known type. The content is exported, and the type is in the interface, so it should work anyway.

I can export my registry (get this):

  <record name="my.addon.interfaces.IMySettings.project_description" interface="my.addon..interfaces.IMySettings" field="project_description">
<value>&lt;p&gt;This is my project description&lt;/p&gt;</value>
1 Like

Are you using the code above? I see you've also to restart after an install/reinstall of the product.

Yes

Update: (taken from memory) I have the entry in registry..xml of my profile

1 Like

This is strange, because the export should include a serialization of a RichTextValue object and not its output or raw value. My export using the registry is:

<records interface="myproduct.controlpanels.my_control_panel.controlpanel.IMyControlPanel" prefix="myproduct.my_control_panel">
value key="nmyfield">
RichTextValue object. (Did you mean <attribute>.raw or <attribute>.output?)
</value>
</records>

with portal_setup:

<record name="myproduct.mycontrol_panel.myfield" interface="myproduct.controlpanels.mycontrol_panel.controlpanel.IMyThemeControlPanel" field="myfield">
    <value>&lt;p&gt;This is my project description&lt;/p&gt;</value>
  </record>

basically, the html of the field changes from (working):

<div class="mb-3 field fieldname-form.widgets.myfield widget-mode-input " id="formfield-form-widgets-myfield" data-fieldname="form.widgets.myfield">
  <label class="form-label" for="form-widgets-myfield">
    My Field

    
  </label>

<textarea name="form.widgets.myfield" class="form-control">html bla bla</textarea>

to (not working):

<div class="mb-3 field fieldname-form.widgets.value widget-mode-input empty " id="formfield-form-widgets-value" data-fieldname="form.widgets.value">
  <label class="form-label" for="form-widgets-value">
    My Field

    
  </label>
  

  <textarea name="form.widgets.value" class="form-control"></textarea>

it is like it is getting "value" as the field...