diff options
author | bdriesen <bram.driesen@capgemini.com> | 2018-05-31 14:49:03 +0300 |
---|---|---|
committer | bdriesen <bram.driesen@capgemini.com> | 2018-05-31 14:49:03 +0300 |
commit | 08ae28a1f68e97f6b4b1e1ea9221df6839766d6a (patch) | |
tree | c5b414bf7b31ecad348ad9d8ff9e89e3c2313a10 | |
parent | 573f7217b0c6ec0375ff7c42cc1eb97f2b09f68d (diff) |
Make the contact form placeholders/buttons/text configurable (like translating)
-rw-r--r-- | exampleSite/config.toml | 5 | ||||
-rwxr-xr-x | layouts/partials/contact-form.html | 16 |
2 files changed, 16 insertions, 5 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index b65080f..1fa9abc 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -199,6 +199,11 @@ title = "My Awesome Title" enable = true title = "Get In Touch" message = "Lorem ipsum dolor sit amet consectetur adipisicing elit. Eveniet nam itaque ipsam iste provident quo ipsam iste provident." + name_placeholder = "Your name" + email_placeholder = "Your email" + email_disclaimer = "We'll never share your email with anyone else." + message_placeholder = "Please enter a message." + button_text = "Submit" # Footer section # Note here that the copyright and attribution statement must remain as part of the license agreement. If you wish to remove this, please contact freehtml5 and pay for a professional license. diff --git a/layouts/partials/contact-form.html b/layouts/partials/contact-form.html index 156541b..99371fb 100755 --- a/layouts/partials/contact-form.html +++ b/layouts/partials/contact-form.html @@ -11,25 +11,31 @@ <div class="col-md-6"> <div class="form-group"> <!-- <label for="inputName">First name</label> --> - <input type="text" class="form-control" id="inputName" placeholder="Your name" name="_name"> + {{ with .Site.Params.contact }} + <input type="text" class="form-control" id="inputName" placeholder="{{ .name_placeholder }}" name="_name"> + {{ end }} </div> </div> <div class="col-md-6"> <div class="form-group"> - <input type="email" class="form-control" id="inputEmail" placeholder="Your email" name="_replyto" required> - <small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small> + <input type="email" class="form-control" id="inputEmail" placeholder="{{ .email_placeholder }}" name="_replyto" required> + {{ with .Site.Params.contact }} + <small id="emailHelp" class="form-text text-muted">{{ .email_disclaimer }}</small> + {{ end }} </div> </div> <div class="col-md-12"> <div class="form-group"> - <textarea class="form-control" id="inputBody" cols="30" rows="7" placeholder="Please enter a message." name="message"></textarea> + {{ with .Site.Params.contact }} + <textarea class="form-control" id="inputBody" cols="30" rows="7" placeholder="{{ .message_placeholder }}" name="message"></textarea> + {{ end }} </div> </div> <div class="col-md-12"> <div class="form-group"> <input type="hidden" name="_subject" value="New website query"> <input type="text" name="_gotcha" style="display:none"> - <button type="submit" class="btn btn-primary btn-outline" value="Send">Submit</button> + <button type="submit" class="btn btn-primary btn-outline" value="Send">{{ with .Site.Params.contact }}{{ .button_text }}{{ end }}</button> <!-- <input type="submit" name="submit" value="Send message" class="btn btn-primary btn-outline"> --> </div> </div> |