CodeCharge Studio

Using Include Pages

During the process of creating a site, there is usually some content that has to appear on every page. For instance, the navigation controls used to access the different pages within the site should appear on each page so that the user can easily move between pages. To provide a uniform and centralized way of including common content into multiple pages, CodeCharge Studio allows pages to be designated as includable.

This is done by:

  1. Setting the Includable property for a page to Yes in the page Properties window.
  2. After defining an includable page, include the page within other pages. To do this, open the page where the include page is to be added and place the cursor at the point where the include page should appear. Then click  Include Page under the Forms tab of the Toolbox.
  3. The dialog will appear so that you can select the page to be included. You can assign a name for the include page control object that is used for reference purposes within the site code.

    Include pages can be added to as many pages as desired within the site. The main advantage of using include pages is that changes to the common content need to be made in one location only. After changing the contents of an include page, the changes will be reflected in all the other pages where the page is included. This makes it easier to maintain consistent functionality and appearance as well as reduce the size of pages that share common content.

Absolute and Relative URLs

Concerning includable pages, it is possible to include a page located in a different folder. However, the included page should not have manually created relative links to other pages or resources. For instance, a relative link is provided in the pages as follows:

<img src="images/logo.gif">

Note that the relative link would not work if the includable page was included into another page in a different folder. This is because the relative URL would no longer point to the correct resource. However, a fully qualified URL would work regardless of the location of the includable page. For instance, the following is an example of an fully qualified URL:

<img src="http://www.mysite.com/images/logo.gif">

If an includable page is used in multiple folders and the page contains manually created links, the URL's should be absolute or you should have local copies of the includable page in the folder where the page is included.

See also

Using the Page Template


On-line, printable versions and updates