Skip to main content

How do I create custom Merge Fields for Online Actions Themes?

  • January 21, 2025
  • 0 replies
  • 22 views

Happie Pingol
Forum|alt.badge.img

Custom Merge Fields allow you to create flexible Themes that can be easily customized by your colleagues without requiring them to edit code. 

 

Step 1: Understand Merge Fields in Themes 

  1. Merge Fields are placeholders that get replaced with actual content when a form is created 

  1. Standard merge fields include {{Title}}, {{Description}}, and {{FormContent}} 

  1. Custom merge fields allow for additional customization options 

  1. They're especially useful for images, text blocks, or other variable content 

 

Step 2: Create a Theme with custom Merge Fields 

  1. Open Online Actions and navigate to Settings > Themes 

  1. Create a new Theme or edit an existing one 

  1. In your Theme HTML, add custom merge fields using double curly braces: 

  1. <div class="header"> 

  1.   <img src="{{HeaderImage}}" alt="{{HeaderAltText}}"> 

  1.   <h2>{{HeaderText}}</h2> 

</div> 

  1. Save your Theme with these custom merge fields in place 

 

Step 3: Define your custom Merge Fields 

  1. After saving your Theme, scroll down to the "Custom Merge Fields" section 

  1. Click "Add Custom Merge Field" 

  1. Enter the name of your merge field exactly as it appears in your code (e.g., "HeaderImage") 

  1. Select the appropriate field type: 

  • Text - For single-line text 

  • Text Area - For multi-line text 

  • Image - For image uploads 

  1. Add a label and description to help form creators understand what to enter 

  1. Click "Save" to add the merge field 

 

Step 4: Set default values (optional) 

  1. For each custom merge field, you can set a default value 

  1. This value will be used if the form creator doesn't specify something else 

  1. For images, upload a default image 

  1. For text, enter default text 

  1. This ensures your Theme always looks complete, even if not all fields are customized 

 

Step 5: Use your Theme with custom Merge Fields 

  1. Create or edit an Online Actions form 

  1. On the Build Page step, select your Theme from the dropdown 

  1. You'll see input fields for all your custom merge fields 

  1. Enter the specific content for this form 

  1. Preview the form to see how your custom content appears in the Theme 

 

What else do you need help with?