|
Fichiers inclus PHP 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
- Open Frontpage
- Select File > Open Web
- In the box that appears type your full URL eg.
http://www.yourdomain.com/
- You'll now be prompted for your Frontpage user
name and password
- 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:
- The link.
This can be relative: mypage.php
or relative to the site root: /mypage.php
or absolute: http://www.mysite.com/mypage.php
- The "normal" state of the image
- 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:
- In Frontpage go to Tools>Options>Configure
Editors
- Choose "Add"
- Put PHP for file type
- Put the same information as you have for htm,
html etc. - this is usually
Editor Name: FrontPage
Command: frontpg.exe
- Save
|