Home content top
 
 

How do I add custom Javascript/HTML/CSS code to my web site?

You can add your own HTML or Javascript/CSS code to your site's pages. This is useful for having more control over the display or for embedding specific tools from other web sites e.g.Google Analytics .

 

You can add custom code in the following ways:

Editing the Source code of a specific page

You can edit the HTML code or add Javascript/CSS to a specific pages as follows:

  1. Select the article in the Web Office that you wish to edit the HTML for or add Javascript code to.
  2. Within the document editor select the Source button; the HTML source code of the article will now be displayed.
  3. Add the required Javascript/HTML code.
  4. Click the Source button again to return to the article. You could then preview it before selecting Save to commit your changes.

Adding code to several pages

If you wish to add HTML or Javascript/CSS code to several pages on your web site you can do this through adding an article to a layout as follows:

  1. First create a layout that will work for all the pages you want to add the source code to. For more details on creating layouts see the Themes & Layouts guide.
  2. Add an article component to your layout.
  3. Select the edit icon to open the article component's settings.
  4. Within the article component settings you can  add your HTML or Javascript code to your layout in the following ways:
    HTML (Advanced) - Selecting the HTML (advanced) option (as shown below will enable you to paste the code directly into your layout.
    HTML-advanced


    A specific article - If you add your code to the source of an an article (as described earlier) you can then select a specific article within the article component (as shown below). This method is advantageous if you wish to add your source code to several articles. By selecting the article containing the source in all the layouts will mean any alterations to the code can then be made in one place (the article's source) instead of editing each layout.

select-specific-article


Justin Ruffell-Ward - Insight Support, 21/04/2010

Feedback:
Andi Northrop (www.bournemouthfamilychurch.org)03/06/2010 15:35
I'd like to start using a feature from www.issuu.com/smartlook called Smartlook which opens various file types in the browser.

However, to do this I need to place the javascript code immediately before the tag.

I can't find a way to do this, is it possible?

Also, I'd like to implement this globally for the entire site.
Andi Northrop (www.bournemouthfamilychurch.org)03/06/2010 15:41
Scratch my last sentence, I don't want to do it globally, only on certain pages.
Andi Northrop (www.bournemouthfamilychurch.org)03/06/2010 17:00
Sorry to clog up the response feed, just noticed the tag didn't show up.

The code needs to go immediately before the "end body" tag.
Justin Ruffell-Ward - Insight Support (shareinsight.co.uk)04/06/2010 09:37
If you add the code to the 'source' of an article and then call it from an article component in the footer of your layouts then that should work.
Andi Northrop (www.bournemouthfamilychurch.org)04/06/2010 13:56
Brilliant, thank you, that worked perfectly.