filsa.net: Frontier / Scripts / Pageheader Macros / Why Pageheader?
This is part of Phil's Script Archive

Why Pageheader?

Background for those who used Frontier 4.2.3.

X-Sender: <phil@203.216.116.2
Mime-Version: 1.0
Date: Tue, 2 Dec 1997 11:07:53 +0900
To: Frontier Work <frontier-work@scripting.com>;
From: Philip Suh <phil@gaijins.com>;
Subject: RE: A new filter script? (longish but worth your time)
Reply-To: Frontier Work <frontier-work@scripting.com>;
Sender: <frontier-work@scripting.com>;
Precedence: Bulk

>So that we can make modifications to what's already been generated that
>isn't changable by directives.
>
>For example, I can't put 'onLoad="window.alert(document.url)"' in the
>body tag with directives. The body tag is completely generated by
>pageHeader from start to finish, with only the coloring directives
>inbetween.

Hi Dave!

Wow, lots of discussion on this thread.

Pageheader is important, lots of HTML stuff goes up there: <BASE> <LINK> <SCRIPT> <STYLE> <META> <TITLE>. Beginners are going to want to access it easily.

Then there's all the stuff that goes in the <BODY> tag.

My suggestion: Think of this from the HTML perspective. What we want is the contents of the <HEAD> container, plus the <BODY> tag (or for frames, no body tag).

#headerTemplate is a special outline that gets rendered separately from everything else. It looks something like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Draft//EN">
<HTML>
<HEAD>
{macro for base tag}
{macro for link tag}
{macro for script tag}
{macro for style tag}
{macro for meta tag}
<title>
</HEAD>
{macro for body tag}

The pageheader(title) script just renders this outline, inserting the title tag where necessary. This is added to the rendered text at the *end* of the rendering process, i.e. it does not get rendered again (this will keep Javascript clean).

renderedtext = pageheadertext + renderedtext

Actually, if this is the case, pageheader could be run at the end of the rendering process (are there advantages to this?).

NOTE: A pre-rendered headerOutline is visibly very easy to understand, because we do outlines all the time for our html. Macros are a small leap but not unfamiliar. It's modular, easy to upkeep. Really Anal People (RAP) can even reorder the macros to their hearts desire, so their output comes in a certain order.

If there is ever a new HTML spec that adds more tags to go in the <HEAD> container, we just modify the outline and add a new macro.

You don't even have to ship macros for each and every tag there (just do a dummy macro --return ("")) and count on the small army of macro writers out there to fill in the gaps for you. Give us room to work and we'll fill it in. I'd be willing to provide you with scripts for these.

The <body> macro should ship with support for the relative reference for the #background image. Also, the <body> macro should support two directives: #insertBodyTag (boolean:false for frames) and #insertInBodyTag (string:for all that javascript handler stuff).

Each macro gets documented, along with it's directives. Beginners access the <<HEAD> tag through directives. Mid-level users looking for more functionality download third-party macros, which are written by the power users. You just have to provide the framework.

And the pageheader script? It fades into the background, where it belongs. :-)

Phil

PS: This is basically the same as Jim R.'s request on the Fronter 5 request site.

http://www.frontierusers.net/featurerequests/requests/html/pageheaderoutline.html

View the Source:


© copyright 1997-98 by Philip Suh. Comments are appreciated.
This page last updated on 3/16/98; 10:28:33 PM.
<http://www.filsa.net/frontier/scripts/PageheaderMacros/whyPageheader.html>
filsa.net: Frontier / Scripts / Pageheader Macros / Why Pageheader?