AkazieIT / grav-theme-akazie-wood

This is a theme of Akazie IT GmbH and is intended for simple websites without great features
https://demo.akazie.com/akazie-wood/
MIT License
12 stars 7 forks source link

Form template not being displayed correctly #19

Closed Legi428 closed 1 year ago

Legi428 commented 2 years ago

Hey :)

I've been implementing the Akazie theme but for some reason the page content when using the form template is not parsed correctly. I see the HTML on the site directly. Default template works just fine. I also found other themes to display this form page correctly. Also: The page content is using the full width (there's no padding) while the Default template is centered with a fixed width.

What it looks like: Akazie

The HTML shows that the form tag is not wrapped at all to provide the proper visuals. grafik

The page content is only: Das ist ein Test

The frontmatter is:

title: Anfrage
date: '00:31 23-09-2022'
form:
    name: contact
    fields:
        name:
            label: Name
            placeholder: 'Enter your name'
            autocomplete: 'on'
            type: text
            validate:
                required: true
        email:
            label: Email
            placeholder: 'Enter your email address'
            type: email
            validate:
                required: true
        message:
            label: Message
            placeholder: 'Enter your message'
            type: textarea
            validate:
                required: true
        basic-captcha:
            type: basic-captcha
            placeholder: 'Bitte kopieren Sie die 10 Zahlen oder Buchstaben'
            label: 'Are you human?'
    buttons:
        submit:
            type: submit
            value: Submit
        reset:
            type: reset
            value: Reset
    process:
        basic-captcha:
            message: 'Humanity verification failed, please try again...'
        save:
            fileprefix: contact-
            dateformat: Ymd-His-u
            extension: txt
            body: '{% include ''forms/data.txt.twig'' %}'
        email:
            subject: '[Site Contact Form] {{ form.value.name|e }}'
            body: '{% include ''forms/data.html.twig'' %}'
        message: 'Thank you for getting in touch!'
body_classes: 'title-center title-h1h2'
grimnebluna commented 2 years ago

Hi

sorry for the late response.

it looks like you haven't properly implemented the form within a modular page. is that correct? ( see below or here)

your yaml below form: (as above) should be inside the modular.md:


title: Contact content: items: '@self.modular' order: by: folder dir: asc cache_enable: false form: YOUR FORM YAML CODE

within the modular folder folder should be a folder with a form.md and the following content:


cache_enable: false title: 'YOURTITLE'

if all updates went smoothly, there should be no form.html.twig from akazie-wood. you can check if there's a form.html.twig inside the /templates/forms folder. If there is a form.html.twig, you can try to check what happens if you delete it.