Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom label for FieldPanel in Wagtail

Tags:

wagtail

Is there any way to set custom label to FieldPanel in Wagtail? I want to do something like:

class BlogPage(Page):
    intro = models.CharField(max_length=255)

    panels = [
        FieldPanel('intro', label = "My custom label")
    ]
like image 610
alesdvorak.cz Avatar asked Dec 15 '22 00:12

alesdvorak.cz


1 Answers

The model field accepts a verbose_name property, which will be picked up for use as a form field label:

class BlogPage(Page):
    intro = models.CharField(max_length=255, verbose_name="My custom label")

    panels = [
        FieldPanel('intro')
    ]
like image 130
gasman Avatar answered Jan 21 '23 22:01

gasman