user.html.macros.pageheaderV


File: pageheaderV.sit.hqx
Server: www.orange-road.com
Modified: 1/20/98; 12:52:08 AM
Size: 10K
Owner: khagler@orange-road.com
Attachments: None

pageheaderV Macro

Overview

This macro started life as a version of the standard pageHeader macro that would include the SGML doctype (necessary for valid HTML documents) and use standard META tags for the HTML Hints info instead of comments stuck on the end of the document.

Eventually, I noticed that several different people had released their own pageheader macro, and that although each of these did some things the others (and mine) didn't do, nobody's macro did everything. So, I made some other improvements to my own version, incorporated things I liked from other people's macros, and added various things that were requested.

Major Contributors

Jim Correia
META tag code, which was expanded to handle LINK tags and BODY JavaScript attributes.
Phil Suh
BASE tags and frame support.
Phil Hudson
Inspiration for adding LINK support, default META information, suggestions for BASE improvements, JavaScript BODY tag attributes, and some code optimization.

Development History

1.0, 8 Oct 97
Initial public release.
1.0.1, 10 Oct 97
Slight code revision for improved efficiency, documentation modified for greater clarity.
1.0.2, 13 Oct 97
Body JavaScript directives can now be overriden with a nil value, for times when you have a table-level directive that you don't want to apply to one page.
1.0.3, 20 Jan 98
The META tags automatically generated with the object creation, modification, and build dates now use ISO 8601 date format. This is the preferred format of every source I could find that had an opinion, and the Mac-style date/time strings I was generating before aren't very common, so it seemed like a good idea.

Documentation

Base Tags

To insert BASE tags, use the #base directive. The parameter for this directive can be a string, list, or record:

If the directive is a list, the first item is the href and the second is the target. If the directive is a record, the 'href' element is the href and the 'targ' element is the target.

You can also set the target in a seperate directive:
#basetarget "_parent"

META Tags

Any directive that begins with meta become a meta tag, and any directive that begins with metaEquiv becomes an HTTP-EQUIV tag. For example:

#metaDescription "A online resource for Frontier" becomes
<meta name="Description" content="A online resource for Frontier">
#metaExpires "Mon, 01 Jan 1996 23:59:59 GMT" becomes
<meta name="Expires" content= "Mon, 01 Jan 1996 23:59:59 GMT">
#metaEquivSTUFF "TheContents" becomes
<meta http-equiv="STUFF" Contents="TheContents">

A meta tag with a hyphen in its name when it is inside a page object:
#["metaResource-Type"] "lottery ticket"

If the meta directive is in a table, you don't need the quotes and brackets. For example, if the directive above were in a table, the cell's name would be just #metaResource-Type.

#metaRefresh is a special case included as a shortcut.

#metaRefresh "5;URL=http://www.foo.com/foo.html" becomes
<meta http-equiv="Refresh" Contents="5;URL=http://www.foo.com/foo.html">

LINK Tags

Any directive that begins with link becomes a link tag. For example:

#linkRelGlossary "glossary.html" becomes
<link rel="glossary" content="glossary.html">
#linkRevMade "mailto:khagler@blizzard.com" becomes
<link rev="made" content="mailto:khagler@blizzard.com">

JavaScript Attributes in BODY Tag

Any directive that begins with bodyJS becomes an attribute to the body tag.

#bodyJSonLoad "This is a test" becomes
<body onload="This is a test">

If you have a bodyJS directive in a table, but want a page within that table to have no JavaScript, you can override the table's value with the nil value:
#bodyJSonLoad nil

BASEFONT Tag

Use the baseFont directive with all the BASEFONT attributes as elements in a record. For example:
#baseFont {'face': "verdana, helvetica, arial", 'size': 5, 'colr': red}

Alternately, use these single-parameter directives:

The font face can be either a string with font names seperated by commas, or a list of names.

Note: The BASEFONT tag is deprecated in HTML 4, and you should really use style sheets for this sort of thing anyway. Also, only the size attribute is part of the HTML 3.2 spec. If you use face or color, you must specify the HTML 4 doctype.

Frames Support

HTML files that contain <frameset> tags should not include body tags. You can turn off body tags with #includeBodyTags false.

SGML Doctype Headers

An HTML document must have a doctype declaration at the beginning to be valid. There is a new docType pref. If you set it to an SGML doctype string, that will be used. Otherwise, the HTML 3.2 doctype will be used by default.

Note: If you use frames, or something else that's not part of the HTML 3.2 spec, you are responsible for using the correct doctype. If you don't your document won't be valid HTML.

HTML Hints Revised

Instead of putting this information in a comment block at the end of the page, it's added as meta data. I also added some additional information, inspired by various sources.

The information is added as directives in html.data.page, and is then handled by the code for handling META and LINK tags just as if it had been added by the author. This makes it easy for authors to override the default meta data--just add your own meta directive.

A new preference has been added: distribution. Normal values are "global" and "local."

The following information will be inserted, with default values where appropriate:

Generator Tag Revised

Instead of being a static string ("Frontier 4.2 Mac"), frontier.version() is used to get the version dynamically. sys.os() will be used as soon as it's part of the standard distribution.


Site scripted with Userland Frontier
This page was last built on Mon, Jun 15, 1998 using the Sysop Suite (V1.0f1) on a PowerWave running Frontier.