You can use JavaScript (JS) to add extra or different functionality to your Zendesk help center. We recommend that you create your own custom JavaScript files rather than make changes to the JS files Paligo provides.
To create your own JS files to customize your Zendesk help center:
-
Publish your content to Zendesk and then decide on what extra functionality you need.
-
Create your own JavaScript (JS) files to provide the extra functionality.
-
In Zendesk, browse to Customize design > Edit theme > Edit code and then add your JavaScript files as assets.
-
In Zendesk, open the document_head.hbs template and add the following line to the list of references to JavaScript files:
<script src="{{asset 'yourscript.js'}}"></script>
Where yourscript.js is the name of your JavaScript file, for example, flagicons.js.
-
Publish the template to save it in Zendesk.
When Paligo publishes to Zendesk, it provides a package that downloads in your web browser. The package contains CSS files and JavaScript files, and for the first publication to Zendesk, you need to add some of the files to your Zendesk assets.
We recommend that you create your own custom JavaScript files if you want to add or change functionality in Zendesk. However, if you really need to change the functionality that the Paligo JavaScript files provide, you can customize them. This does have some consequences that you need to be aware of:
-
In future, Paligo may provide updated versions of the JS files. If you copy the updated versions into your Zendesk assets, you will lose the customizations you have made. So you will need to make your changes again.
-
If you decide to not use updated versions of the JS files, your customizations will remain in place. But you will not have any of the extra functionality that is included in any updated versions.
The JavaScript files that Paligo provides are:
File |
Description |
---|---|
paligo-zd.js |
Used for resolving links between articles and embedding code. |
paligo-zd-lightbox.js |
Provides the lightbox functionality for images (when you select an image in an article, a larger version of the image appears). |
paligo-zd-glossary.js |
Provides the pop-up glossary functionality. If there is a glossary term in a Zendesk article, you can hover the cursor over it to display the definition of that term. |
paligo-stickymenu.js |
Provides extra menu features, including:
|
lightbox.min.js |
This script needs to be in place for the lightbox functionality. It is used in conjunction with the paligo-zd-lightbox.js script. |
bootstrap.min.js |
This script needs to be in place for the extra menu features. It is used in conjunction with the paligo-stickymenu.js script. |
To get the Paligo JavaScripts to work in Zendesk, add them as assets and reference them in the document_head.hbs template. This only has to be done once, and it is usually setup when the Paligo to Zendesk integration is set up. For details on moving and referencing the assets, which include CSS as well as JavaScript, see Step 4: Add the CSS and JS files to Assets in Zendesk.
Comments
0 comments
Article is closed for comments.