Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Allow custom inputs (idea) #754

Merged
merged 5 commits into from
May 5, 2020

Conversation

mpourismaiel
Copy link
Member

What this PR does / why we need it:
This is an idea I've been thinking about for a while and when I saw the issue, thought I create a PR for it. It's a breaking change since the config will change, but I added default inputs same as our previous sample. Please let me know what you think.

Which issue this PR fixes:
fixes #753

Special notes for your reviewer:
This is a work in progress and an idea. Please do not merge.

Release note:

- **UPDATE IF PR IS APPROVED**

@mpourismaiel mpourismaiel requested a review from stp-ip May 2, 2020 08:39
@mpourismaiel mpourismaiel self-assigned this May 2, 2020
@stp-ip
Copy link
Member

stp-ip commented May 4, 2020

This breaks existing users.

How about keeping the default fields and adding the option to add custom ones after the default ones similar to how you set the config:

[[fields.custom]]
  name = "phone"
  text = "Your Phone *"
  error = "Please enter your phone number" # defaults to theme default
  required = true

In the code we would add our default fields and afterwards iterate through the custom ones.

Thoughts?

@mpourismaiel
Copy link
Member Author

That sounds really good.

@stp-ip stp-ip merged commit 6e5c04c into okkur:master May 5, 2020
@stp-ip
Copy link
Member

stp-ip commented May 5, 2020

Missed the WIP in the title. The code looked finished so ;)

Let me know, if you want me to revert.

@mpourismaiel
Copy link
Member Author

I wasn't sure if the idea was polished enough. If you think it's good then fantastic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Additional contact form fields
2 participants