Welcome to the OpenCities help centre. Search for what you're after, or browse the categories.
Can't find what you're looking for? Submit a support ticket and we'll be in touch.


Create or edit your own device variables

avatar of OpenCities Product Team

OpenCities Product Team

Last updated

This is a Developer task

A device variable can be used to store reusable code snippets. Read more about device variables

To create or edit your own device variable:

  1. Go to More > Device Variables
  2. Select Client Variables.
  3. Choose an existing variable to edit it, or click New or Create New Variable to start fresh.
  4. Fill in the Name, Description and the Default value.
    If you’re editing an OpenCities variable, you can only change the Default value.
  5. Save when you’re done.

OpenCities client variables

Custom fonts

The value of this variable will be included in the site’s rendered HTML header. You can use this variable to reference any custom fonts you want to use within your theme.


<link href="https://fonts.googleapis.com/css?family=Merriweather:400,700|Source+Sans+Pro:300,400,600,700" rel="stylesheet">

Homepage - Do it online Icon width

Homepage Do It Online icons uploaded directly to the page are resized to match your template.

You can edit this value to change the size of the custom Do It Online icon. The format of the value should be ?w=[The width in px, without the unit]



Custom Injection - Header

This variable is included in the HTML header along with the Custom Fonts variable. You can use this variable if any third-party plugin (e.g. Facebook Pixel, Monsido) requires you to include a bit of code in the header of your site.

Custom Injection - Footer

This variable is included just before the closing </body> tag of your site. You can use this variable to include any third-party JavaScript code (e.g. live chat or chatbot code snippet, Google Tag Manager) in the site.

Was this article helpful?
0 out of 1 found this helpful