This is a Developer task |
A device variable can be used to store reusable code snippets. These can range from just text snippets to references to fields.
A good example of a device variable is the OpenCities pagination variable. You can use the following code snippet in your content lists to render the same pagination used by all OpenCities content lists:
<DeviceVar var="OC DV Pagination" />
We call them ‘device variables’ because you can extend this snippet to exclude or include the selected variable depending on the device. The three devices available within OpenCities are desktop, tablet, and mobile.
If you want to include a specific device variable only on a desktop, use the following code snippet:
<DeviceVar var="[Your variable name]" include="Desktop" />
To exclude, use the attribute exclude. You can combine multiple devices using a ‘|’ character, include="Tablet|Mobile".