Hello I am beginner learning wagtail and Django, on my design the contact form is on the homepage and only I founded tutorial for beginners to include a contact form in a dedicated contact page, how I can include a contact form on my homepage?
My model homepage looks like this:
class HomePage(Page):
description = models.CharField(max_length=255, blank=True,)
content_panels = Page.content_panels + [ FieldPanel('description', classname="full") ]
in a tutorial they use this model:
class FormField(AbstractFormField):
page = ParentalKey('FormPage', related_name='custom_form_fields')
class FormPage(AbstractEmailForm):
thank_you_text = RichTextField(blank=True)
content_panels = AbstractEmailForm.content_panels + [
InlinePanel('custom_form_fields', label="Form fields"),
FieldPanel('thank_you_text', classname="full"),
MultiFieldPanel([
FieldRowPanel([
FieldPanel('from_address', classname="col6"),
FieldPanel('to_address', classname="col6"),
]),
FieldPanel('subject'),
], "Email Notification Config"),
]
def get_form_fields(self):
return self.custom_form_fields.all()
but this creates another page that I don't need. How I can add the form on my homepage?
Thank you very much.