frondoc picture

What is Frontier?
Download
News & Updates

Web Tutorial
Scripting Tutorial
BBEdit Scripting
Directory

Mailing Lists
Sample Scripts
Verb Set
Frontier Site Outline

Search
Guestbook
BBS

User's Guide
1 2 3 4 5 6
7 8 9 10 11

Apple File Edit
Main Open Suites
Web Window

Menubar Outline
Script Table WP

frondoc picture

Website Building Improvements in 4.2

Here are several new features implemented in the website framework, suites.html, in Frontier 4.2.

For background, see Website Building with Frontier.

Next/Prev links

Frontier 4.2 can automatically generate Next/Prev links at the top of your pages (or thru the magic of templates, at the bottom too!). To see how they work, check out the MIDAS Website, which as of 12/16/96, has Next/Prevs.

Here's how to try it out. First, if you upgraded from 4.1, be sure you've installed the new Web menu, it's in the Extras folder, it's not part of the standard install. Start with a smallish website, maybe 10 or 12 pages.

Choose "Build NextPrev List..." from the Web menu, enter the address of your website table in the dialog, something like user.websites.midas, and click on OK.

An outline opens, it contains a list of pages in this table. You can reorder the list if you want. You can organize it any way you like, the macros do flat traversals, they ignore the outline structure.

Edit the template for the site, and add calls to the linkNext and linkPrev macros. To see how this is done, install the source for the MIDAS site, it's in the Extras folder too.

After editing the template and building the nextPrevs list, any pages in this site will have Next/Prev links. You can experiment with layout (I will too) or just put them in the upper/left corner of each page.

#define directive

Here's a new directive, #define, that allows us to more easily factor out common elements of a web page, or get the changable stuff close to the top of your source text. A variant, #defineScript, allows us to include scripts that only run locally in the web page as its being rendered.

A #define can only appear in an outline. You say #define "zzz" to define something named zzz, and the lines subordinate to the #define are concatenated to form the definition.

The definitions are stored in html.data.page. The name is zzz, the value is the definition. When you want to reference the text in your pages, include its name in curly braces: {zzz}.

#defineScript

#defineScript works just like #define, except the object it creates is a script, which you can then call from a macro:

{"The script returned " + zzz ()}

The scripts can take parameters, and as usual, the value returned is inserted in the output stream.

Templates can be outlines

Buried in html.buildPageTable is a small bit of code that allows a revolution to happen here. This might be the biggest new feature in 4.2.

Now you can build structured templates using the outliner. Intermix macros, HTML tags, glossary references, and use the outline structure to sort it all out.

When Frontier needs the template it converts the outline to a string. The built-in conversion adds tabs and carriage returns, so the result is prettier when people do a View Source on your pages.

The Frontier site now uses an outline template. I've included a copy of the template outline in the Extras folder of this release.

If you convert your templates to outlines you may find bugs. I did! You can certainly build and maintain more complex templates using the outliner. It's a win.

New rule about ftpSite tables

Even if isLocal is false, they can have a folder cell. We'll render into that folder if it exists. If it doesn't exist -- change in policy -- instead of rendering into the System Folder, we create a folder structure in the Frontier folder.

Loading existing websites

html.loadFolder loads a folder that represents a website into Frontier's object database.

html.data.textFileReaders is a table containing scripts that clean up files produced by various HTML-editing apps. In the first beta release, readers for FrontPage 2.0, Home Page 1.0, and PageMill 2.0 are provided. We plan to provide drivers for NetObjects Fusion and plain text and perhaps others.

This will combine with the publishingAgent suite (not released yet) to allow Frontier to render pages for people who don't use Frontier. It's the key to realizing the vision of large dynamic sites with lots of authors.

html.data.standardMacros.imageRef

An important step towards full management of images and other media in the object database.

The first param can be an address, if so, it points to a binary object. The binary type is the type of the file we'll create. We create the file in the same folder as HTML file we're building.

If the first param is a string, then we shoot out to the root table for the site looking in any tables named images we find. We generate a relative IMG tag pointing to the file.

If it's a GIF file, we'll properly set the height and width. If we can include Brent's commands in this release, we'll do the same for JPEG files. (Brent?)

windows picture Here's the test... If it works you should see the Windows logo here. This is semi-important. It's the first time a Windows logo has appeared on this website. I think it looks kind of neat. Onward!


© Copyright 1996-97 UserLand Software. This page was last built on 5/7/97; 1:19:07 PM. It was originally posted on 12/10/96; 7:06:48 AM. Internet service provided by Conxion.