DSPLAY 3.x migration guide

My template uses @dsplay/react-template-utils SDK

In this case you just need to upgrade the SDK to the latest version.

npm i -S @dsplay/react-template-utils@4

Don’t forget to pack and redeploy your template on DSPLAY Web Manager

My template uses @dsplay/template-utils SDK

In this case you just need to upgrade the SDK to the latest version.

with a package manager

If your project uses npm just run:

npm update

without a package manager

If your project doesn’t use a package manager, just download the UMD version from https://unpkg.com/@dsplay/template-utils and replace your local file.

Don’t forget to pack and redeploy your template on DSPLAY Web Manager

My template doesn’t use any SDK

It’s time to start using them.

To make the changes on your template follow these simple steps:

  1. Add the SDK corresponding to your project type (React or Javascript/JQuery)
  2. Search for uses of window.dsplay_media, window.dsplay_config and window.dsplay_template and replace them by the SDK-provided functions/objects.
    1. Javascript/jQuery
       // replace this
       var someMediaValue = window.dsplay_media.images;
       var someTemplateValue = window.dsplay_template.bg_color;
      
       // by this
       var someMediaValue = dsplayTemplateUtils.media.images;
       var someTemplateValue = dsplayTemplateUtils.tval('bg_color');
      
    2. React
       // replace this
       const someMediaValue = window.dsplay_media.images;
       const someTemplateValue = window.dsplay_template.bg_color;
      
       // by this
       const media = useMedia();
       const someMediaValue = media.images;
       const someTemplateValue = useTemplateVal('bg_color');
      

You can always check the boilerplate projects to see how to use the SDK in more detail.

IMPORTANT If you update your template it will continue to work on the previous version of DSPLAY app, so DON’T WORRY and upgrade your templates even if you are still using an old version of DSPLAY app.


Copyright © 2012-2023 DSPLAY - Digital Signage. Distributed by an MIT license.