NetCommunity Administrators may wish to add JavaScript to certain pages in NetCommunity in order to add customizations or site tracking features.  This can be done multiple ways, and will depend on the type of JavaScript that is being inserted.

Adding code to a page in NetCommunity:
Adding code to the page will only apply on that page. This can be handy if you need to affect something specific without affecting other pages on the site.
  1. Create an Unformatted Text Part.
  2. Paste the code into the part, and check the Advanced Options checkbox to add the code to either the location of the part within the <body>, end of the <body> (after jQuery is loaded) or <head> sections of the page.
  3. Save the Part, and insert the part on the desired page.

Adding code to the Template in NetCommunity: 
Sometimes it is necessary to have code on multiple pages in the NetCommunity site.  If these pages share a common template, the code can be added at the template level. This is handy if you need to update multiple pages at once on the site.
  1. Create an Unformatted Text Part
  2. Paste the code into the part, and check the Advanced Options checkbox to add the code to the <body> or <head> sections of the page.
  3. Go to Site Explorer > Pages and Templates, and select the template that you would like to add the script to.
  4. Insert the Unformatted Text Part into a content placeholder on the template.

Adding code to a NetCommunity Layout:
If multiple templates are in use, but pages are using the same layout, the code can be inserted into the HTML of the layout.
  1. Select Site Explorer > Layouts, and choose the layout that you would like to insert the JavaScript in to.
  2. Edit the layout, and select the View tab.
  3. Select HTML Code.
  4. The code can then be inserted into the HTML editor.  Depending on the type of code that is being inserted, you can place the script in the code where appropriate (i.e. top or bottom).


NOTE: For specific questions on how to create or edit parts, pages, templates, and layouts, please contact support. However, we can not troubleshoot any custom code added to the site. Please note that it is possible that some custom code (especially JavaScript) may interfere with the functionality of NetCommunity parts. Also please note that multiple additions of JavaScript/custom code on a page or template may conflict with each other. Be sure to test thoroughly (such as forms) before deploying any custom code throughout your NetCommunity site.