huntsfromshadow
huntsfromshadow

Reputation: 1085

Height of FieldPanel for Rich Text Editor in Wagtail 2.8

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

Answers (1)

Muneer Muhammed
Muneer Muhammed

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

Related Questions