Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Multi-column forms?

Started by Muut Archive 9 years ago · 17 replies · 1120 views
9 years ago

Is there any way to create multi-column forms? I have a form which requires business and owner details, obviously having one long form is not ideal.

How would i create a 2 columned form using Grav? is it even possible - I am thinking that its not?

9 years ago

Actually, i don't get how these work? Do I just add them to my form and split out the fields?

9 years ago

Yes you add them to your forms, basically you nest your regular fields inside the form fields.

9 years ago

rhukster, do you have a basic example of this layout? I added them but it didn't seem to work. I got a submit button that was all.

9 years ago

There are many useful form fields that sadly only seem available for use in the admin panel and not as a 'front-end' form. I think this might be one of them.

9 years ago

Do you have example theme for bookings or hotels/guesthouse website??

Like this http://www.amazingsuiterome.com

Let me know please if its possible to creata site like this with Grav thank you guys

9 years ago

Can anyone give an example of a form with two columns? Something Grav error displays. Interested in the upper part. That's how I have:

YAML
form:
    name: contact
    fields:
            columns:
                type: columns
                    fields:
                        column1:
                            type: column
                                fields:
                                    - name: name
                                      label: Name
                                      placeholder:
                                      autofocus: on
                                      autocomplete: on
                                      type: text
                                      outerclasses:
                                      validate:
                                        required: true

                                    - name: category
                                      label: Сategory
                                      placeholder:
                                      type: text
                                      outerclasses:

                        column2:

Where is the error?

9 years ago

I have similar to the code snippet above, but I don't get and error. I simply get no form fields.

However if I remove the column bit I get the fields again

9 years ago

@rikoriko yeah you could create that with Grav, just create a theme and you can style it up how you want.

9 years ago

For @alr3id. What is styles?! @rikoriko talking about bookings! This is only possible with the help of a plugin or web application (there are) that is installed as a separate platform and uses the database.

9 years ago

@Stanislav, styles, as in you create the look of the site. You create a theme you need to style it otherwise, it would just be plain old HTML :)

9 years ago

Hey you said that there are plugin and web app for bookings can you tell me how to implement them on my website using grav?? Coz im having troubles doing that

9 years ago

He said it would need a separate plugin or web app. Basically you could build a PHP or Rails app to do this independently of the Grav install.

9 years ago

Turns out multi-column support is only for admin are use and not for use on our Grav forms, which is a pain in the ass if you ask me. The docs seem to give a totally different idea and are very misleading.

9 years ago

Exactly also I wanted to write. Colums are valid only in blueprints.

9 years ago

We do have plans to work on a form builder tool and that would bring a lot of things to the frontend that are currently only for admin. Frontend is really quite basic when it comes to forms. They are flexible though. You can still style the forms as you like, but it's a manual process requiring css.

The new forms plugin also has fieldset type that can allow you to group bits of forms and align them into columns with css.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1330 9 years ago
Archive · by Muut Archive, 9 years ago
2 922 9 years ago
Archive · by Muut Archive, 9 years ago
2 4052 9 years ago
Archive · by Muut Archive, 9 years ago
1 2930 9 years ago
Archive · by Muut Archive, 9 years ago
3 1109 9 years ago