Can I insert scripts in CMS?


As indicated in the FAQ entry on scripts, scripts may not be embedded in CMS pages or uploaded to site file storage.

On many occasions, NDSU-IT has been asked to make exception and allow embedding some Javascript to make a special button or form work.  Most of the time, a work-around is available that also fixes accessibility issues that would arise from using the script.  Examples follow.

Help Desk - Live Help example

As shown on the Help Desk page, a Live Help button to chat with a Help Desk representative is included in the page.  The Help Desk requested for Javascript code be inserted in the page to render the button and link.

The Javascript would have changed the button image based on the availability of Help Desk representatives.  With minor depreciated functionality, a single image was inserted into the page as a link.  Alt and title text were provided for the image and the link, to make the button accessible.

How to insert a button like this?

  1. Save the button graphic to your local computer
  2. Upload the button graphic to CMS in the Filelist module
  3. Identify what Web address the script would take visitors to.  Sometimes, you can click an example link provided by the vendor and copy-paste the address directly.  Other times, you may need to view the script source to identify what the address will be.
  4. In a content element RTE, click the Insert/modify image button to insert an image.  Select the button graphic
  5. Click the button graphic and click the Insert/modify image button again to add Alternate Text and Title and click OK to apply the changes
  6. Click the button graphic and click the Insert Web Link button to make the button graphic into a link.  Choose External URL and enter the address in the URL field.  Choose Style = navigation-link to prevent link styles from appearing in this button link, and set the Title to briefly describe the function of the link

For example,


Important: if you use an image for a link as described herein, it is imperative that you provide alt text for the image to maintain accessibility.

Top of page