Skip to main content

How to: Use Themes to style Online Actions forms

Themes allow web developers more control and flexibility over the appearance of Online Actions forms.
​
You can quickly change your Online Actions form font and colors in the Design step.
​
With Themes, you can insert code to wrap your forms in a consistent design that mirrors your website style. You can customize your Themes using CSS, images, header/footer navigation menus, analytics trackers, and metatags. Using Themes requires knowledge of web development. Building and troubleshooting your coding will need to be done by your vendor or someone at your organization experienced with web coding.
​
If your form has a custom CSS file selected on the Build Step, your Theme by default will not load it. To have your Theme incorporate the custom CSS file, add the Custom CSS merge field to your Theme:

<link href="{{CustomCss}}" rel="stylesheet"/>
​
Themes can be used across forms, so multiple forms can reference the same Theme. You can create as many Themes as you need.
​
You can also create responsive Themes that change depending on values selected on your forms. For instance, if you want to use different social share metadata for each form using a particular Theme, you can use form merge fields to dynamically change the social share values set on each form.

If you have access to multiple committees, you can also share Themes between Committees. If you want other committees to be able to use the Theme but not change it, you can restrict editing by setting it to Cannot be updated by committee shared with.

Getting started

From the Online Actions dashboard, select the Themes tab.

You can open a previously created Theme to edit or select Create New Theme.
​
If you are creating a new Theme, enter the Name and Description section for your new Theme.


​

<head> Content

In the Head section, you can add a document title, reference CSS files, insert analytics tracking code, JavaScript, or other code needed for the design you want to function properly. It's not necessary to add the open and closing tags, <head> </head>, for this section. You should ensure your Theme is mobile responsive. This tool will not do that automatically.
​
The following elements can go inside the <head> element:

  • <title> (this element is required in an HTML document)

  • <style>

  • <base>

  • <link>

  • <meta>

  • <script>

  • <noscript>


Using a Theme gives you control over the content that wraps your form. We make very few assumptions about what code you want in the <head> of your page. This means, there are a number of values set on the form level you may want to have merged into the <head> of your Theme.
​

The following are values that are set on a form. You can merge them into your Theme by selecting the merge fields from the Merge Field dropdown menu.
​

  • Form Title

  • Google Analytics ID

  • Open Graph Tags for Social Sharing, title, image, description

  • Custom CSS file

Example <head> code

Below is some example head code you can use in your Themes. For most of the merge fields (field names wrapped in {{ }}), we have provided an 'or' statement where you can provide a fallback option in case the person creating the form did not provide a value. You can remove the 'or' and the fallback value if you do not want to provide a fallback.
​

Example of a merge field with and without a fallback option:

Without: {{OpenGraphTitle}} With: {{OpenGraphTitle or 'Take Action Now!'}}


Example <head> code:

<title>{{FormTitle}} - Your Org Name</title>  <meta property="og:title" content="{{OpenGraphTitle or 'Replace With Your Default Title'}}" /> <meta property="og:description" content="{{OpenGraphDescription or 'Replace With Your Default Descirption'}}" /> <meta property="og:image" content="{{OpenGraphImage or 'Replace With the full URL of a default image'}}" />  {{if CustomCss}}<link href="{{CustomCss}}" rel="stylesheet" type="text/css" /{{end}}  <!-- Google Analytics --> <script type="text/javascript">   (function() {     var ga = document.createElement('script');     ga.type = 'text/javascript';     ga.async = true;     ga.src = ('https:' === document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';     var s = document.getElementsByTagName('script')[0];     s.parentNode.insertBefore(ga, s);   })();    try {     var _gaq = _gaq || [];           _gaq.push(["_setAccount", "{{GoogleAnalyticsId or 'REPLACE with your default GA ID'}}"]);     _gaq.push(["_trackPageview"]);        } catch (err) {   } </script>

<body> Content

The <body> element contains all the contents of an HTML document, such as text, hyperlinks, images, tables, lists, etc. It's not necessary to add the open and closing tags <body> </body> for this section.
​
You must embed your form here, otherwise, forms will not appear in the Theme. Choose Embed Form from the Form Merge Fields menu.


You can add in a Main Image field here that will allow the value to be set on individual forms.


​

Manage & Embed Files

The Manage and Embed file option allows you to upload image and CSS files. After uploading files, when choosing to embed a specific file, the system will generate the secure URL for the file. You will need to add the proper HTML markup.
​

Form Merge Fields

Form Merge Fields pulls information set on the form into the Theme the form is using. You should always choose to insert Embed Form somewhere in the body content in order for a form to appear within a Theme.

Form Merge Fields options include:

  • Embed Form

  • Form Title

  • Main Image

  • Open Graph Title

  • Open Graph Image

  • Open Graph Description

  • Google Analytics ID

  • Custom CSS

  • Designation

  • Committee ID

  • Committee Name

  • Committee Short Name

Applying a Theme

Once a Theme is published, it's available in the Published Themes dropdown menu in the Form Theme section of the Basics page. Choose your Theme from those available in the dropdown menu, then save or publish your form.


​

Did this answer your question?