Adding JavaScript - XMPieLab/uStore-NG GitHub Wiki
here are several 3rd party tools that can be added to a website by including a JavaScript library and adding a snippet of code to every page in the site. These types of tools can provide additional functionality, for example:
- To add tracking or reporting (Google Tag Manager or similar)
- A chat service (Freshchat, LiveChat or similar)
- Social media feeds (Facebook, Twitter or similar)
- Mapping (Google Maps or similar)
- Animation (GreenSock, Anime, Three or similar)
- And much more...
To add these type of JavaScript libraries, you need to create a custom uStore NG Theme by duplicating the XMPie AquaBlue theme and then adding the desired JavaScript library to the custom theme. Following are steps to complete this process:
Process
- Set up your development environment as described here.
- Download the 3rd party JavaScript library and add it to the theme in this folder:
/src/ustore-internal/static - To add the library into the <head> tag of every page in the uStore Theme, edit this file:
/src/public/index.html - Test your code while in development mode by running the local webserver.
- Publish the new theme as described here.
Training video
For a detailed example, watch the Adding a chat service to your theme video on XMPie Campus.