Ford & Mason Ltd
HOME
ABOUT
CONTACT
RESOURCES
ADVERTISING



donations support the development of
cronolog.org
and
refcards.com

next up previous contents index
Next: Protocol-dependent menu items Up: GN cache files Previous: Search items within


Including HTML within menus

One of the main features of interest to sites using GN as a Web server is the facility for serving HTML documents. Links to HTML files can of course be included in menus as item type 0, and if the h type modifier is appended HTML and plain text versions of the item can exist, to be served to Gopher and HTTP clients respectively. HTML can also be embedded within menu files. Such information will only be served to browsers accessing the server with HTTP requests.

HTML can be included in the menu file, outside of menu items, between a line containing `httpText=' and a line containing `endText='. This might be useful to incorporate headings and introductory text surrounding the bullet list created for the menu items.

There are also three different ways of specifying items that are only accessible by HTTP clients.

  • An item can be specified by the fields Name and Path with the value httponly specified in the Attribute field. The URL is constructed automatically from information contained in the Path field, and in the Host and Port fields, if specified.

  • The URLlink keyword can be used instead of the Name keyword to specify an item with a URL that cannot be automatically created. In this case the URL is specified with the URL keyword, instead of the Path, Host and Port fields.

  • The Hname keyword specifies the name of an HTTP-only item. It is used instead of the Name keyword. The URL is generated from the Path, Host and Port fields and included as the HREF of an anchor start tag which is automatically embedded at the beginning of the name field (the start anchor tag does not actually appear in the menu file, its presence is implicit). An end anchor tag must be included in the value of the Hname field, which can also include other arbitrary HTML.

The following example illustrates the various possibilities:

    # Sample GN server menu file showing HTTP possibilities.

httpText= <H1>Welcome</H1>

Welcome to our server. endText=

Name=Introduction to our server. Path=0h/docs/intro

Name=HTML documentation Path=0/docs/html-docs.html Attribute=httponly

URLlink=CERN's WWW home page. URL=http://info.cern.ch/TheProject

Hname=Our main Web server</A> (<EM>not</EM> running GN). Path= Port=70


next up previous contents index
Next: Protocol-dependent menu items Up: GN cache files Previous: Search items within

[ITCP]Spinning the Web by Andrew Ford
© 1995 International Thomson Publishing
© 2002 Andrew Ford and Ford & Mason Ltd
Note: this HTML document was generated in December 1994 directly from the LaTeX source files using LaTeX2HTML. It was formatted into our standard page layout using the Template Toolkit. The document is mainly of historical interest as obviously many of the sites mentioned have long since disappeared.

 
Copyright © 1996-2002 Ford & Mason Ltd