This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device.
It is vitally important to carefully consider the logical storage of any files held on a web server. Inevitably, a site will grow and making the correct choices now will save work later on.
Currently this site is housed on a single server. The file storage structure and the file-naming convention reflects my need to group documents covering four distinct subject areas.
The home page is the top level page and it is named index.php. I am using PHP, but if I was serving an html file, this would be named index.htm, or index.html. In the case of this website, when a user enters http://jmcsweeney.co.uk into a browser, it is the index.php file that is found and served. Consequently, one file at the top level must be named index.php, or whatever file extension is appropriate.
The horizontal navigation bar on that page holds links to five distinct sections The folders used to hold each set of relevant files are named:
I use the following naming convention for all files and folders:
The following illustration shows how I organise the file structure for this site. The diagram is simplifed and omits several folders. e.g. the t171 folder, which is nested inside computing. I have also omitted the search folder.
One of the most common errors committed when writing HTML, or any kind of Web programming, is the incorrect naming of paths linking files and documents. There are many reasons for requiring the use of path names, but most common are those written for hyperlinks and importing image files to a document. The result of an error in the path name in these instances, will be either a broken link, or a blank space.
To reference the index.php pages, used for each content section (again the search section is omitted here), from a hyperlink on the home page, I use the following naming procedure:
Conversely, for any index.php page in one of the content sections (or any other page at the same level) to reference the home page, it must "climb" the file structure. This where the use of ../ naming convention comes into play. The following references should, hopefully, make this clearer:
Now for the tricky part. Given the structure in the above diagram, how
do I reference, from a hyperlink say on webdesign/index.php, a
page that is nested in another directory, say m206/index.php?
To implement this, the path name in webdesign/index.php must climb
up one level and then descend two levels with:
../computing/m206/index.php
Conversely, for a hyperlink on m206/index.php
to reference webdesign/index.php,
the path name must climb two levels and descend one with:
../../webdesign/index.php
One final tip when writing path names. Use a relative path, ../../webdesign/index.php, rather than an absolute reference, which requires the writing of a URI (Uniform Resource Identifier)- http://jmcsweeney.co.uk/webdesign/index.php.
A URI specifies a single resource on a specified machine linked to the Internet; relative path names do not. Providing documents with relative path names ensures portability if and when those documents are transfered to another server. The exception to this rule, of course, is when a URI is required to reference an external file stored on another server.
Next page » Browsers
Previous page « Usability Guidelines