Menus#

HFRD Hypertext Menu Primer

ˆ [next] [previous][contents]


3 - Menus




GThe purpose of this menuing system is to provide a simple interface to required files. 

LTo allow the easy management of information by users not needing to explore Jthe relative complexities of HTML a simple menuing system makes a clearly Npresented page available to the client, allowing versatile document retrieval Land searching. This is provided through the maintenance of a simple, plain-Mtext file, which may be edited on any platform (PC, VMS, Unix) and then just 'placed into the appropriate data area. 

OThis plain-text file is essentially made up of a series of lines that comprise Ma file name followed by a description (series of words to the end of line). GEach of these lines is presented to the client as an item in a list ;that can be selected for access. In its simplest form:)

  FILE1.TXT   This is the First File%  FILE2.TXT   This is the Second File3  FILE3.GIF   This is an Image (and the third) File
 

An online example:



JWhen specifying the file items within a menu the file name may not containMspaces (not unreasonably!). The first space encountered terminates the file Fname. Spaces between the end of the file name and the next non-space Mcharacter are ignored. All characters from the first non-space are included Oin the item description. The description cannot be continued on the following Mline. It is reported as an error if no description accompanies a file name. %

3.1 - Providing a Menu Title



LTo allow a title to be placed on the menu (large, bold font) the plain-text Ofile may comprise two blank-line separated sections. The first section, which Kshould be only a single line, is interpreted as the title and presented as Msuch. The blank line indicates that the next section of lines represent the Jlist of items (files for access) to be presented to the user. An example would be:

  This is an Example Menu$  FILE1.TXT   This is the First File%  FILE2.TXT   This is the Second File3  FILE3.GIF   This is an Image (and the third) File
 

An online example:

+

3.2 - Providing a Menu Description




MIn addition to a title it is often desirable to provide a brief introduction Pto, or description of, the menu and its purpose, etc. This may be accomplished Jby adding another blank-line delimited section. It must follow the title Lline and precede the menu items, and may comprise as many lines as required. For example:

  This is an Example Menu+  This is an example menu.  It has a fairly,  simple structure, yet provides a elegantly  presented user menu.$  FILE1.TXT   This is the First File%  FILE2.TXT   This is the Second File3  FILE3.GIF   This is an Image (and the third) File
 

An online example:

!

3.3 - File Specification




eFile are specified using URL syntax. See 2 - Data Organisation. %

3.4 - Menu File Requirements



IThe menu file, being simple plain-text, may be maintained using the text Oeditor of choice on the platform of choice (PC, VMS or Unix), and subsequently Nplaced into the appropriate data area. For instance, a PC Pathworks user may AUSE to the appropriate VMS data area, then according to Lpreference, copy the file to a local disk, edit it, and copy it back to the Ndata area, or may edit directly on the network drive. The former is probably Osafer, allowing intermediate editing to be saved locally without affecting the actual online menu. !

3.4.1 - Menu File Naming



MA menu file may have any name acceptable to VMS, but must have the extension 2.MENU or .MNU (MS-DOS compliant)Mfor the server to recognise it. It is recommended to name a directory-based 2menu HOME.MENU (or HOME.MNU) forthe following reason.

LIf the server is given a URL comprising only a directory name it attempts toJopen a home page for that directory. It tries to open one of four files in the following order: 

    
  1. HOME.HTML
  2. HOME.HTM
  3. HOME.MENU
  4. HOME.MNU
NIn this way directory access may be transparently supported by either HTML or HMENU files. Any directory meant to made accessable to a user need only Kcontain one of these files, and if the client specifies only the directory Jname a home page will be found. If none of these files can be opened the server returns an error.  

The following are example URLs:8

  /hyperdata/  This one exists (home page for HFRD)J  /hyperdata/html/  This one does not exist (at least at time of writing!)


/The following provides an online demonstration:



MNote that the URL directory specification has a final "/". This indicates itis a directory not a file. 

3.4.2 - Restrictions



KThe menu text is interpreted by the browser as HTML. This allows the menu Jfile to contain HTML tags to enrich the presentation if desired. It also Ameans that some characters cannot be used within the text B(due to HTML restrictions). These are few and easily substituted:



Note:

EAlthough allowed, extensive HTML markup of a MENU file is counter-Iproductive and is discouraged. If this is desired, then the file is Bbetter considered an HTML file and not a MENU file. Rename it to 5filename.HTML and forget the menuing functionality.
 

Blank Lines




JPlease remember the purpose of a blank line within a MENU file file is to Oseparate the functional sections (title, description, items). Arbitrary blank lines cannot be included. !

3.4.3 - File Permissions



PAs the server executes as a normally privileged process, files it accesses must Mbe world-readable, or specifically have the server account granted access in an ACL. 

OA protected file results in the server returning an error message and aborting the request. "

3.5 - Online Menu Example



MThe first of these links retrieves an larger example menu containing some of Nthe features described in the section on additional functionality, the second Gis a copy of its plain-text source. There are actually two files with Gidentical content here. As with other similar examples in this Kdocument, the reason for the difference in presentation is the first has a L.TXT file type (and is treated by the server as plain-text), while Jthe second has a .MENU file type (and is interpreted as a menu). 






ˆ [next] [previous][contents]