Sprocket Rocket
  • Sprocket Rocket Design System
  • Initial Setup
    • Setup HubL Local Server
    • Setup SR App Locally
    • Clone LaunchPad Starter
  • Create a New Module
    • Design
    • Code
    • Implementation
    • Create a Pull Request
    • Fields JSON
  • Code Patterns
    • Design Settings
    • Headings
    • Responsive Images
    • Implementing Forms
    • Typography
    • CTA/Button
    • Spacers
  • PR Review
    • Design / Code Review
    • Implementation Review
  • Handoff Relay Checklist
    • Client Request - Handoff
    • Page/Template Design - Handoff
    • Module Design - Handoff
    • Page/Template Development - Handoff
    • Module Development - Handoff
    • Review & Delivery - Handoff
  • Guides and Tutorials
    • Code Snippets
    • Lazy Loading
    • How to setup the blog subscription notification emails
    • 404 Error Tracking Event with Google Analytics and Google Tag Manager
    • How to setup a form to be used with SR Conversational Form 01
    • Upgrading Bootstrap to Latest Version
  • HS Page Launch (QC)
  • SR Agency Website Review Checklist (QC)
Powered by GitBook
On this page
  • Implementing Forms
  • JSON
  1. Code Patterns

Implementing Forms

Implementing Forms

Where ever we use forms, we need to include all of the follow fields in order to use all the features of the forms.

<div class="sr-form">
	{% if module.form.title is truthy %}
		{% set no_title = False %}
	{% else %}
		{% set no_title = True %}
	{% endif %}
	{% if module.form.form.form_id %}
		{% form
			form_key="{{name}}",
			form_to_use="{{module.form.form.form_id}}"
			title="{{module.form.title}}"
			no_title="{{no_title}}"
			follow_up_type_simple="{{module.form.follow_up_type_simple}}"
			simple_email_for_live_id="{{module.form.simple_email_for_live_id}}"
			follow_up_type_automation="{{module.form.follow_up_type_automation}}"
			response_response_type="{{module.form.form.response_type}}"
			response_redirect_id="{{module.form.form.redirect_id}}"
			response_redirect_url="{{module.form.form.redirect_url}}"
			response_message="{{module.form.form.message}}"
			notifications_are_overridden="{{module.form.notifications_are_overridden}}"
			notifications_override_email_addresses="{{module.form.notifications_override_email_addresses}}"
			gotowebinar_webinar_key="{{module.form.form.gotowebinar_webinar_key}}"
		%}
	{% endif %}
</div>

For implementing Salesforce into a form use

HUBL
sfdc_campaign=‘{{ module.salesforcecampaign_field }}’

JSON
{
  "name" : "sfdc_campaign",
  "label" : "Salesforce campaign",
  "type" : "salesforcecampaign",
  "default" : null
}

JSON

{
  "id": "1",
  "name": "form",
  "children": [{
      "name": "title",
      "label": "Form Title",
      "type": "text",
      "default": null
    },
    {
      "name": "form",
      "label": "Form",
      "type": "form",
      "default": {
        "response_type": "redirect",
        "message": "Thanks for submitting the form."
      }
    },
    {
      "id": "notifications_are_overridden",
      "name": "notifications_are_overridden",
      "label": "Send form notifications to specified email addresses instead of the form defaults",
      "type": "boolean",
      "default": false
    },
    {
      "name": "notifications_override_email_addresses",
      "label": "Email Addresses",
      "visibility": {
        "controlling_field": "notifications_are_overridden",
        "controlling_value_regex": "true",
        "operator": "EQUAL"
      },
      "type": "email",
      "default": null
    },
    {
      "id": "follow_up_type_simple",
      "name": "follow_up_type_simple",
      "label": "Send a follow-up email",
      "type": "boolean",
      "default": false
    },
    {
      "name": "simple_email_for_live_id",
      "label": "Email",
      "visibility": {
        "controlling_field": "follow_up_type_simple",
        "controlling_value_regex": "true",
        "operator": "EQUAL"
      },
      "type": "followupemail",
      "default": null
    }
  ],
  "label": "Form",
  "type": "group",
  "default": {
    "form": {
      "response_type": "redirect",
      "message": "Thanks for submitting the form."
    },
    "notifications_are_overridden": false,
    "follow_up_type_automation": false,
    "follow_up_type_simple": false
  }
}
PreviousResponsive ImagesNextTypography

Last updated 5 years ago