In GitHub - collective/collective.richdescription: Formatable description field for Archetypes and Dexterity we use an plone.app.textfield.RichText
field with plone.app.z3cform.widget.RichTextFieldWidget
for the description. I would like to its visual height to the minimum, because a description is short. How can I do this?
z3c.form
is designed to facilitate CSS based customizations. I would look at the CSS classes used in the output and check whether they allow the modifications you need.
can you override the iframe of the editor height with a css !important statement in your custom css file, e.g. 80px ?
speaking in z3c form directives language you could inject the height
parameter into the richdescription widgets pattern_options
like here Configure Pattern Options for TinyMCE in your custom Contenttype ... current tinyMCE height is read from registry here Products.CMFPlone/tinymce.py at master · plone/Products.CMFPlone · GitHub
Solution for minimal possible height:
PATTERN_OPTIONS = {
"tiny": {
"height": 1,
}
}
# ... in schema
widget(
"mysmalltextfield",
RichTextFieldWidget,
pattern_options=PATTERN_OPTIONS,
)
1 Like