Skip to content

Latest commit

 

History

History
108 lines (77 loc) · 3.79 KB

contact-form.md

File metadata and controls

108 lines (77 loc) · 3.79 KB
layout title searchable versions
widget
Contact Form
true
version url
Version 2.0
/widgets/v2/contact-form/
version url
Version 1.0
/widgets/v1/contact-form/

Contact form

Add a contact form widget to your template.

You can add a contact form widget to your template to allow the visitor to send an email to the email address in the manage shared contact section or customised email address by the Editor user. The widget can be later customised within the Editor.

Examples

Basic usage

To include a contact form widget in your template you will need to add the following line:

{% highlight python %} {% raw %}

{{widget('contactform', 'contact', {})|raw}}

{% endraw %} {% endhighlight %}

Example usage

{% highlight python %} {% raw %}

{{widget('contactform', 'contact', { 'text': 'Submit', 'formTitle': 'Contact Us', 'email': 'profile' })|raw}}

{% endraw %} {% endhighlight %}

Resulting HTML:

{% highlight html %} {% raw %}

Contact Us
Your Email
Message <textarea class="textarea textarea--message contactform__textarea js-message-input" id="page-zones__main-widgets__ContactFormWidget__textarea--message" name="page-zones__main-widgets__ContactFormWidget__textarea--message"></textarea>

{% endraw %} {% endhighlight %}

Widget options

You can change the following options for the widget:

  • text: The text on the button

  • italic: The text style on the button. true or false (default)

  • bold: The text style on the button. true or false (default)

  • align: The text style on the button. You can set it:

    • justifyleft
    • justifyright
    • justifycenter (default)
    • justifyfull
  • fontSize: The text style on the button. You can set it: inherit (default), 14, 16, 18, 20, 22, 24

  • formTitle: The subject for the email

  • email: The email address that the final message will be sent to. Using profile (default), will mean that it will use the email set in the manage shared email address settings. Alternatively you can set a custom email address, e.g. example@example.com

  • goalSource: The source of the URL to redirect to after the form is submitted. Using profile will mean it will use the internal URL, or you can set a URL of your choice

  • goalUrl: The URL after submit the form

    • If the goalSource is set to profile, it should be set to an internal link, e.g. home
    • If the goalSource is set to custom, it should be set to an external link, e.g. www.mysite.com