diff options
author | Clara Wildpaner <clara@wildpaner.com> | 2021-04-04 17:00:22 +0300 |
---|---|---|
committer | Clara Wildpaner <clara@wildpaner.com> | 2021-04-04 17:22:33 +0300 |
commit | 9206c784bf64313f3d28190a8595ce588d6078ac (patch) | |
tree | 64288467ac367ec58c18102b5439be2cc2a81c7d | |
parent | 8f4fb16b4bc73fbc94cdd4e5e14f3762a7280016 (diff) |
Make contact form configurable
-rw-r--r-- | exampleSite/config.toml | 16 | ||||
-rw-r--r-- | layouts/contact/list.html | 21 |
2 files changed, 27 insertions, 10 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index d6e9f59..5c3df9a 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -39,6 +39,22 @@ summarylength = 25 googleAnalitycsID = "Your ID" # We're using formspree.io for form handling, paste your formspree url below formspreeFormUrl = "https://formspree.io/myykjpje" + + # Contact Form + [params.contactForm] + placeholder_first_name = "First Name" + placeholder_last_name = "Last Name" + placeholder_email = "Email" + placeholder_project_type = "Project Type" + placeholder_about_the_project = "About the Project" + send_message = "Send Message" + + [[params.contactForm.projectType]] + value = "gd" + title = "Graphics Design" + [[params.contactForm.projectType]] + value = "wd" + title = "Web Design" # Navbar Action Button [params.navAction] diff --git a/layouts/contact/list.html b/layouts/contact/list.html index 889a8f6..f20f73f 100644 --- a/layouts/contact/list.html +++ b/layouts/contact/list.html @@ -13,31 +13,32 @@ <form id="contact-form" action="{{ .Site.Params.formspreeFormUrl }}" method="POST"> <div class="row"> <div class="col-lg-6"> - <input type="text" class="form-control" name="first-name" id="first-name" placeholder="First Name"> + <input type="text" class="form-control" name="first-name" id="first-name" placeholder="{{ .Site.Params.contactForm.placeholder_first_name }}"> </div> <div class="col-lg-6"> - <input type="text" class="form-control" name="last-name" id="last-name" placeholder="Last Name"> + <input type="text" class="form-control" name="last-name" id="last-name" placeholder="{{ .Site.Params.contactForm.placeholder_last_name }}"> </div> <div class="col-lg-6"> - <input type="email" class="form-control" name="email" id="email" placeholder="Email"> + <input type="email" class="form-control" name="email" id="email" placeholder="{{ .Site.Params.contactForm.placeholder_email }}"> </div> <div class="col-lg-6"> <div class="select-wrapper"> <select class="form-control" id="projectType" name="project-type"> - <option value="" selected disabled hidden>Project Type</option> - <option value="gd">Graphics Design</option> - <option value="wb">Web Design</option> + <option value="" selected disabled hidden>{{ .Site.Params.contactForm.placeholder_project_type }}</option> + {{ range .Site.Params.contactForm.projectType }} + <option value="{{ .value }}">{{ .title }}</option> + {{ end }} </select> </div> </div> <div class="col-12"> - <textarea class="form-control" id="aboutProject" name="about-project" rows="6" placeholder="About the Project"></textarea> + <textarea class="form-control" id="aboutProject" name="about-project" rows="6" placeholder="{{ .Site.Params.contactForm.placeholder_about_the_project }}"></textarea> </div> <div class="col-12"> <button type="submit" class="btn btn-primary" id="contact-form-button"> <span class="btn-area"> - <span data-text="Send Message"> - Send Message + <span data-text="{{ .Site.Params.contactForm.send_message }}"> + {{ .Site.Params.contactForm.send_message }} </span> </span> </button> @@ -50,4 +51,4 @@ </div> </div> </section> -{{ end }}
\ No newline at end of file +{{ end }} |