Environment Variables
A guide to the creation and implementation of environment variables
In this article, we will explore the concept of Environment Variables, how to create them, and why they are valuable. Let's dive in!
Introduction
Environment Variables are an advanced feature within the Website App that allows you to set different URL content to display on different devices while they are showing the same playlist. This feature is particularly useful when you have a shared playlist across multiple devices and want to display custom Website App content based on each device.
Why Use Environment Variables
Environment Variables offer powerful capabilities. They allow you to have a shared playlist with general media and content that needs to be shown on multiple devices. Additionally, you can include custom Website App content within the same playlist, specific to each device. This avoids the need to create additional playlists just to support custom Web App content, simplifying the organization.
For instance, let's consider a use case: A company wants to display a playlist with the same slideshow content (e.g., company notices and images) across six offices located in different cities. However, they also want to have a specific slide in the playlist that displays the website for each office's location.
Creating and Using Environment Variables
Now, let's walk through the process of creating and utilizing Environment Variables.
Create Your Environment Variable
- Go to the Devices tab and select a single device where you want to apply the Environment Variable.
- Open the "Details" tab and scroll down to the "Environment Vars" section. Click "Add".
- Enter a Variable Key, which will be used as a label for the Environmental Variable (avoid capital letters or spaces).
- Provide a Value, which should be a secure (https) URL pointing to the desired web content.
Remember, you will repeat this process for other devices, setting the unique URL for the same Variable Key.
Add the Variable to Your Website App
- Navigate to your Playlist and create a new Website App. You can also create the Website App from the Apps section if you prefer organizing it into a specific app folder.
- Under Properties, next to the "URL" field, click the drop-down menu.
- Select the Environmental Variable you previously created from the list. It will automatically populate the URL field.
Step 3: Apply Variable Rules to Different Devices
- Go back to the Devices page and select another device where you want to apply the Environment Variable.
- When adding an Environment Variable, select the existing Variable Key and specify the unique URL (Variable) you want the Website App to display on that device.
Don't forget to apply this to all devices displaying the Website App with the Variable Key set as the URL.
Congratulations! You have now created and applied your first Environment Variable. Remember, when an Environmental Variable is applied, the web content will not be displayed in the page preview. To test, view the URL content on the actual device.
By utilizing Environment Variables in the Website App, you can easily customize the URLs displayed on different devices within the same playlist. It's a straightforward and efficient way to personalize content based on each device.
Updated 6 months ago