Adding a JavaScript Entry

From unroole CMS wiki
Jump to: navigation, search


Unroole Site Builder Admin Panel - Javascript new.png

Creating a new simple JavaScript alert box on page load.

Adding a JavaScript entry to a channel is a good way to add dynamic functionality that may not be provided by a theme. For example adding printing or hover functionality that target specific widgets can be done by creating a JavaScript entry for a channel. Any javascript entries added to a channel are automatically appended to the header of a page in the order specified in the currently active [Theme]. To add a new javascript entry please follow these steps:

  1. Navigate to the JavaScript section under "Channel Content".
  2. Click the 'Create' button.
  3. Enter the name of the JavaScript entry for reference
  4. Add in your JavaScript code. The layout editor provides a number of tags and classes for you to reference. For more information see Layout Structure.
  5. Click 'Save' to finalize the creation of your javascript entry.

Notes:

  • Due to the nature of browser compatibility with certain JavaScript code the system does not check for valid syntax upon JavaScript creation.
  • Any JavaScript entries added to a channel will become available immediately after creation. It is highly recommended to target specific html tags or attributes unique to page versions if this JavaScript entry is only application to a particular version of a page.