University of Malta  WWW WORKSHOP 

SESSION 4
PAGE ORGANISATION
TABLES


General Principles

Connectivity

Navigation: The Hyperspace Compass

Contents

Inserting Non-Local Links with Composer

Recall from the last session that there are three kinds of link corresponding to three classes of destination. Local links, dealt with in session 2, point to destinations in the same document. Next we look at the insertion of non-local links which point beyond the file which contains them. To understand these, we must first see how files relate to each other.

Files and Directories

Below is an incomplete schematic diagram of my webspace. Notice first of all that it has the shape of an upside-down tree, reflecting the hierarchical organisation of directories (black) and files (white)

Organising Non Local Links

The basic problem manifests itself as follows: how can a link appearing in the file index.html underneath wwww make a reference to any other file in the hierarchy, e.g. links.html? The mechanism for creating the link is the same as before, namely, by using the "links" icon in Composer, but the question is, how to refer to the external file.

Absolute URLs

The obvious answer is to use the full (or absolute) URL of the file. Using this method, the file links.html would be referred to as "http://staff.um.edu.mt/mros/wwww/links.html"
There are two diffulties with this approach, however:

Relative URLs

Both of these problems are addressed by relative URLs, which spell out a target's address relative to the location of the current document.

The simplest kind of relative URL is just a filename: to solve the above problem, we simply use "links.html", and the browser looks for the file in the same directory as the current document.

Now suppose that we require an additional link from within that same index.html to a file that is not in the current directory, such as anyfile.html.This is achieved by simply giving the sequence of directories, separated by slashes, followed by the filename, namely: "session1/anyfile.html"

Links to files that are higher in the hierarchy are accessed in similar way, the difference being that they must emply the special directory name ".." which always points to the parent directory. So a link from anyfile.html to links.html would be "../links.html". Files and directories yet higher can be addressed by iterating this scheme, so that "../../links.html" looks in the directory above that, and so on.

The great advantage of relative URLs is that documents that employ them are portable. An entire hierarchy of self referring documents can be moved to another location without modification provided relative URLs are used to build the links.

Links to Other Servers

The one case where it is necessary to employ absolute URLs is when the target resides on another server. For instance, to access the exellent internet bookshop at http://www.amazon.com, it really is necessary for the link to refer using an absolute URL. You can see where a link is referring by observing the small box at the bottom of the window frame.

The role of index.html

If you omit to mention the filename at the end of a URL (thus ending with a directory), most servers assume the standard filename "index.html". It is therefore good practice to reserve this name for the file that acts as an entry point to each directory, as exemplified in the above hierarchy.

Exercise on Non-Local Links

To do the exercise you need to download using FTP.

Organisation of Web Pages

Directory Structure

The design of a website involves not only the creation of individual pages, but a structure that pages can inhabit. In order to ensure that the collection of pages may grow in a controlled way, it is worthwhile investing some effort towards a sound design for such a structure.

The principle structuring device available to the html author is the directory. Directories may contain files or subdirectories. Use of the latter immediately provides a kind of hierarchy, as seen in the following diagram of structure underlying this course:

Note first of all that the main directory mainly contains subdirectories, each of which is devoted to a conceptually separate aspect of the course, hence: one directory for each session, another for the description, another for images, etc.

Note also that there are two files: links.html and index.html. The first is simply a file that happens contain a list of links that are pertinent to the course. The other file is a bit more special for two reasons.

  1. It contains the course home page. This is important for the course, but it is also important for the directory to have a single file which acts as a kind of entry point to its contents, much as a store guide shows a client where to find items in a supermarket.
  2. It is called "index.html". Servers are usually set up so that if asked for a directory rather than a file, they will automatically look for a standard filename in that directory. The most widely used standard name is "index.html"
So it is highly recommended to always provide an index.html for each directory!.

Web Page Organisation

It is beyond the scope of this course to teach the principles of web page design. Most of the time it comes down to using the medium to support the communication of the message.

Exercise 4

  1. Using Windows, create a local directory for your department, office or course, and within it, create a subdirectory (e.g. "people" for information about the people in your group, or "topics" for information about your course).
  2. For each subdirectory, create an "index.html" and start to fill it with relevant information. Try including some tabular information as shown above. You might wish to copy and adapt items in the templates directory for this step.
  3. When you feel ready, test the system using the browser, adding and changing the contents as you like.
  4. Publish the entire hierarchy of files in your web directory.

Course Home CSC Home Resources

Mike Rosner (mros@cs.um.edu.mt)

[Tue Sep 28 18:41:09 1999]