Reputation: 1085
Working on a site in Wagtail 2.8 and my model has a RichTextField.
It shows up in the admin editor but it defaults to a single line if their is no text in the field (as in when the model is created).
Is their a way to have the FieldPanel show up larger?
My Content Panels decleration in the model class. Description is the rich text field.
content_panels = (
Page.content_panels
+ [
MultiFieldPanel(
[
ImageChooserPanel("image"),
FieldPanel("start_date"),
FieldPanel("end_date"),
FieldPanel("starting_location"),
FieldPanel("starting_address"),
FieldPanel("lattitude"),
FieldPanel("longitude"),
FieldPanel("ride_difficulty"),
FieldPanel("google_map_frame"),
],
heading="Event Details",
),
# This is the Rich Text field
FieldPanel("description", heading="Event Description", classname="full"),
]
Upvotes: 0
Views: 262
Reputation: 953
I have handled it using a custom CSS. Please find the below given example. You can add the required CSS to meet your requirements here.
.Draftail-Editor{
border: 1px solid #e6e6e6!important;
border-radius: 5px!important;
padding-bottom: 70px!important;
}
And using webhook registered the CSS. I don't see any other widgets to help in this respect.
@hooks.register('insert_editor_css')
def editor_css():
return format_html(
'<link rel="stylesheet" href="{}">',
static('css/custom_admin.css')
)
Upvotes: 1