Ecommerce Templates > General Help > Include files

Include files

All the Frontpage ecommerce templates use include files. These allow you to update the whole site by making changes on a single page. They are typically used for news items, header and footer sections - anything really that appears the same on all or most of the pages on a site. The include pages are kept in a folder called /includes/. We've added a brief explanation below on how to use them with the ASP and PHP templates.

Frontpage includes

The ASP templates use Frontpage includes - they're very simple to use and can really be added to and deleted at will.

Modifying an include page

In Frontpage folder view open the includes folder and double click on the file you want to change. Make the modifications and on saving, all the pages that are linked to that include file will be automatically updated. There are only a couple of things to be wary of. If the include file uses graphics, make sure that your new graphics will fit into the space provided for them. Some include files, typically ones used for news sections, use smaller text. This is a achieved through .css class - take a look at the code and you'll probably see something like this: <td class="smaller"> or <p class="smaller"> - if this is the case, and you want to maintain the look, you may need to manually add the class to the <p> tag when adding a new paragraph. Speaking of <p> tags, be careful as sometimes Frontpage will add them to your code, both on the include page and the main page which contains the include - this may cause some extra spacing to occur and will mess up your design, particularly in Netscape 7. To delete them open the page in HTML view, delete and save, making sure you have the "Preserve existing HTML" box checked in Page Options.

Note: Only code that is between the opening and closing <BODY> tags will be read in include files, so if you have to put some script into the <HEAD> section, it will have to be moved to the <BODY>

PHP includes

There are a couple of issues with the Frontpage version when using the PHP templates. Frontpage extensions do not work with pages with the .php extension, so this means that FrontPage Includes and Frontpage Navigation do not work. We have found a neat way around these issues, but there are a couple of things to bear in mind.

First, for include pages, we have just used PHP includes. It's already set up for you, and you will find the included pages in the includes folder. Unlike FrontPage includes however, all links will be relative to the file that is doing the including. So, for this reason we recommend you use links relative to the site root if you want to use the same include files in folders and sub folders.

Examples of different ways to link pages are . . .

  • This is a relative link: mypage.php
  • This is a link relative to the site root: /mypage.php
  • This is an absolute link: http://www.mysite.com/mypage.php

The include page will not show up when you preview in a browser, so you'll need to upload the site to your server to view your modifications. Alternatively you can work "live"on the server:

How to work "live" on the server

  1. Open Frontpage
  2. Select File > Open Web
  3. In the box that appears type your full URL eg. http://www.yourdomain.com/
  4. You'll now be prompted for your Frontpage user name and password
  5. Once verified, your site will be open and live, any changes you make on "saving" will be made to your live site

PHP includes and navigation

Because FrontPage Navigation is not available, you will have to make up and over buttons for the navigation. (This does not apply to templates which use DHTML PopOut menus as navigation of course.) To change navigation, open the page which contains the navigation. (Normally includes/leftnavigation.htm.) You will see some lines of code such as . . .
addrollover('special.php','images/special.gif','images/specialov.gif');
To add buttons to the navigation, just add extra lines here, or edit the existing ones. The parameters are:

  1. The link.
    This can be relative: mypage.php
    or relative to the site root: /mypage.php
    or absolute: http://www.mysite.com/mypage.php
  2. The "normal" state of the image
  3. The "mouseover" state of the image

The same rules apply about relative links as for the FrontPage Includes however.

Configuring Frontpage for PHP

If Frontpage doesn't recognize the .PHP pages, you'll need to configure it like this:

  1. In Frontpage go to Tools>Options>Configure Editors
  2. Choose "Add"
  3. Put PHP for file type
  4. Put the same information as you have for htm, html etc. - this is usually
    Editor Name: FrontPage
    Command: frontpg.exe
  5. Save