Sub-Areas of the Website


Often a website will have a variety of sub-areas, each with a different subject matter, or focus. The Simple Website Manager easily supports each sub-area as if it was a separate website. It is not necessary to copy the complete source to each sub-area. Setting the $srcdir variable in a local settings file will redirect requests for scripts to the appropriate common location. Likewise, user account files, style sheets, and other areas can be shared if desired. Usually, the pages, images, sounds and upload directories will be separate for each sub-area, with each sub-area having its own table of contents as well. The user account information is normally shared, but can be separate as well.

To create a sub-area on your website, create the directory under the website root and create a src directory underneath that. Next, copy the index.php, initweb.php, style.css, and src/settings.php files to the new directories. Edit the local copy of the settings.php file and point the $srcdir and $datadir variables back to the common website directories. Run the initweb.php script located in the new sub-area, but do not sepcify an admin password. This will create any additional directories that are needed and will confirm that the main source scripts are accessible. Delete the initweb.php script after running it.

If you want to use the pre-defined pages, you can copy the files from the main website pages directory into the local pages directory and make specialized versions of the forms. You can also add the main pages directory to the page search list by setting an entry in the $pagepath array in settings.php. Alternatively, you can create a local file that includes the main file with a php include() function. For example:

 <?php include("/website/pages/_upload.html"); ?>

Replace website with the path to the root directory of your website.

You should now be able to link to the new portion of your website from the main pages. When the sub-area is entered, it will use its local copy of the TOC file, and any sidebar, header and footer files you create in the local pages directory.

Dan's Web Site