Scripts

A Script is a block of code that can be used to perform complex or repetitive actions on the content of a web page. Scripts are created and managed in the Content Delivery interface and can be assigned to pages and master pages. In KnowledgeKube, scripts are written in the JavaScript language, and can take one of three primary forms:

  • In-line Script is written directly into the HTML markup of whatever content you want it to affect. While it can be easier to understand and modify this type of script, its effects are limited to the host markup, meaning it cannot be applied to other areas of your site unless it is written inside a re-usable Markup Asset. Writing in-line scripts relies on knowledge of both HTML and JavaScript, neither of which are taught by this guide.
  • Internal Site Scripts are independent, named units of JavaScript stored within your site. These scripts can be modified as required, and applied wherever they are needed on your site.
  • External Site Scripts are references to units of JavaScript hosted outside of your site. Since this type of script references code rather than defining it, you cannot use KnowledgeKube to modify the code itself. Like internal site scripts, these scripts can be applied wherever they are needed on your site.

To maintain internal and external site scripts, click the Content Delivery icon in the main KnowledgeKube window, then switch to the Scripts panel of the Site Map Inspector.

The scripts panel displaying an internal script.

The appearance of the panel will vary depending on whether an internal script is currently selected, or an external one. Internal scripts will appear in full, while external scripts will simply display the URL of where the script is hosted.

At the bottom of the panel you will see some information about the currently-selected script.

The selected script's information.

To learn how to create and modify scripts for your site, refer to the following topics:

Description Further Reading
Create a site's script using JavaScript language. Creating an Internal Script
Reference external units of JavaScript code within the script markup. Creating an External Script
Modify a script’s markup. Editing a Script
Remove a script from your site. Deleting a Script