## Adding custom HTML to your site

Freeway provides several options for adding specific custom HTML to your site. All these methods allow you to add HTML code via the Freeway user interface, and you do not need to edit the HTML directly. The HTML you have added is stored as part of your site, and is automatically integrated with the HTML generated by Freeway each time you publish or preview your site.

Freeway provides the following methods for adding HTML code to your site:

- Add code to a specific page.
- Extend the code generated for specific objects.
- Reference external content when the page is viewed.
- Insert code at a specific point on a page.
- Import external HTML into a document.
- Use a Freeway action.

These options are described in greater detail in the following sections.

Note: Take care when adding your own HTML to a site. Errors can go unnoticed but may interfere with the correct appearance or operation of the site.

### To add HTML code to a page

- Open the Page menu and choose HTML Markup....
- Choose an option from the Insert pop-up menu to specify where you want to add the code in the page.

You can enter a separate snippet of code for each of the options on the Insert menu.

Options for which you have defined code are shown underlined in the menu:

- Click the OK button to add the HTML.

For example, to add JavaScript code to the page you will typically add it to the section Before </HEAD>. This ensures that it is processed before the body or page content is loaded.

### To extend the code generated for specific objects

Freeway provides an Extended command at several places in the user interface to allow you to add additional parameters to the HTML tag associated with the object you have selected on the page.

The following table lists the different contexts in which you can use the Extended command:

Context | What it affects
Page menu | The <body> tag on the current page.
Hyperlink dialog box | The <a> tag.
Item menu for a graphic item | The <img> tag.
Item menu for a multimedia item | The <embed> tag.
Item menu for a table | The <table> tag.

- Select the item you want to extend, or no item to affect the current page.
- Open the Page or Item menu and choose Extended....

The following dialog box allows you to define name/value pairs to be added to the appropriate HTML tag:

- Click the New... button to add a tag and enter the name and value that you want to insert:

- Click the OK button to add the name/value pair.
- Click the OK button to close the Extended Attributes dialog box.

The above example adds a parameter to the <body> tag:

`<body OnLoad="alert(Please register)">`

When the page is loaded into a browser this will cause a JavaScript alert to be displayed:

Contents