Upload a ZIP archive (Rich Media Templates syntax)
This guide refers to developing custom Rich Media pages
Important notice
Starting from iOS 9, the operating system enables App Transport Security by default and requires all the network connection to support HTTPS and Perfect Secrecy. To use images, videos or other content for Rich Media that comes from non-secure HTTP servers you have to disable ATS in your app.
To disable ATS for your application, please follow this post.
Template structure
A template is simply a .zip archive that can contain HTML, JavaScript, CSS and images as Rich Media assets. The archive must contain an index.html file in its root.
Please make sure that your index.html is UTF-8 encoded.
Template placeholders
You can use placeholders in the Rich Media templates that will allow you to change and localize the values in Rich Media content.
A placeholder must follow the format below:
{{ Placeholder name | Type | Default value }}
Where:
Placeholder name — is the name of the placeholder that will be visible in the Rich Media editor.
Type — is the type of the placeholder. The type can be any of the following values:
color — color input
text — text input
html — text area (multiline text)
Default value — default value that is used if no value is provided in the editor. If none is set then the Placeholder name is used as a default value.
Example:
{{Header text|text|Tell Us What You Think}}
Adding Pushwoosh.json
You can group placeholders so they would be linked together in the Rich Media editor:
To achieve that, add the pushwoosh.json file to the archive with your Rich Media template next to the index.html file.
The structure of the file is very simple and should be self-explanatory:
Example
Custom forms for surveys are a common use case for custom rich media templates. These forms allow you to gather valuable user feedback. A pre-designed template with a custom survey form is available in the Default templates. Use this as a starting point for your own surveys.
When creating forms, follow some best practices to ensure compatibility and seamless functionality within the Richmedia Editor.
Here’s another example from one of the default templates available in the Control Panel.
Monitor performance of Custom Rich Media
You can also monitor the performance of custom Rich Media content that you create and upload to Pushwoosh as a ZIP file.
You can track how people interact with your Rich Media by:
Button clicks
Link clicks
Form submits
To enable Pushwoosh to track these interactions:
Add an "id" attribute to each element you wish to track.
For example:
To track link clicks:
To track form submits:
To track button clicks:
Add a link to the JavaScript file from the CDN at the end of the tag:
Best practices for custom elements in Rich media
Manage CSS styles carefully
Ensure your CSS styles are specific to avoid conflicts with Richmedia Editor styles. Using low-specificity styles, such as those applied to tag names or common class names, may affect the appearance of the Richmedia Editor. It's best to keep your styles local—wrap your content in a container with a unique ID or class and use this identifier in your CSS selectors for child elements.
Include external libraries
You can integrate CSS or JavaScript libraries (such as Font Awesome, Bootstrap, Tailwind CSS, etc.) to utilize their methods, icons, fonts, animations, and more.
Last updated