Hyperlink Web Control Hyperlink Web Control

Hyperlink Web Control

Adam Evans Adam Evans

Overview

The hyperlink control allows links to be added to a webpage to navigate a user outside of Airkit to and external URL in a new tab or to download a file.

Control Details

Control Properties

HREF

This property specifies the URL to direct the user to when the link is clicked.

Text

The label that the user will see for the hyperlink

Actions

Clicked

This event is fired when a user clicks the hyperlink.  Please note that the user will navigate to the hyperlink regardless of what happens within this event, this event is designed to allow for additional actions and analytic tracking with Airkit's journey if desired.  Please see example above for this use case

Styling

Most web controls have a common set of styling properties you can also learn more about different layout scenarios and tips

Examples

Example 1: Linking to an External URL

mceclip0.png

Simple example here where a link with label (text) "Click Me" will navigate to user to "http://www.airhome.com/anything".

 

Example 2: Linking to a dynamic URL

mceclip1.png

In this example we're using a variable productId in order to create a dynamic link based on the current value.  In the example above we are changing the URL using the {{ }} syntax to insert a variable directly into a string.  This could also be used inside of a List Control template if you had multiple records (products in this example) that you wanted to link to each respectively.  You can learn more about using Lists with arrays.

 

Example 3:  Downloading a File (generated file)

2021-03-16_12-02-27.png

In this example we have a variable 2021-03-16_12-02-50.png that is an Asset data type so we can access the downloadURL on the variable for the href and if the user clicks the link it will download the file to the browser.  You can learn more about creating files and the asset data type.

 

Example 4: Running an Action after a Click

2021-03-16_13-37-43.png

Extending the example above that downloads a generated file, we can also attach some Actions to the Clicked event.  In this case when the user clicks the link to download the file it will start a timer (Create Timer Action) that will with 5 days and then send an SMS asking for CSAT/feedback (Start Chat Bot Action)