Archive of UserLand's first discussion group, started October 5, 1998.

What is the Page Table?

Author:Brent Simmons
Posted:12/10/1998; 12:57:58 PM
Topic:What is the Page Table?
Msg #:1096
Prev/Next:1095 / 1097

Every time a page is rendered, information about the page is placed in a table called the page table.

Every page gets its own page table each time it's rendered.

The page table contains all the #directives that relate to the page. It also contains other information about the page that the website framework generates.

For more information about directives and attributes in the page table:

http://developers.userland.com/stories/directives

When your macros want to access information about the page being rendered, they should look in the page table.

Starting with Frontier 5.1.4, you can get the address of the current page table by calling html.getPageTableAddress ().

http://docserver.userland.com/html/getPageTableAddress

For instance, to get the address of the page that's being rendered, a macro would do this:

local (adrPage = html.getPageTableAddress ()^.adrObject)

"adrObject" is an element in the page table; it's the address of the page that's being rendered.

Note that html.getPageTableAddress () returns an address. You need to de-reference the address -- use the ^ character -- to access elements in the page table.

Elements of the page table that are generated by the website framework include:

adrObject: the address of the page being rendered.

adrSiteRootTable: the address of the top level of the site. This is decided by finding the nearest #ftpSite table.

bodyText: the un-processed source text of the page, minus any directives.

f: the location on disk where the page will be written. Note that even if you're publishing via ftp or to an object database this element will still exist, even though the page may not get written to disk.

fileWriter: the name of the fileWriter -- usually file, ftp, or odb -- that will send the page to the server.

fname: the name of the file to be published. This is generated no matter what the fileWriter is.

indirectTemplate: false if the default #template object is the template, true if a named template is being used.

renderedText: the processed text, the finished text of the page.

siteRootFolder: this is the root folder on disk of the site. This is generated no matter what the fileWriter is.

subdirectoryPath: this is the subdirectory in the siteRootFolder where the page will be published.

url: the URL of the page being published. This is based on the #ftpSite.url, the subDirectoryPath, and the fname.

For more about the #ftpSite table:

http://developers.userland.com/stories/directives#ftpSite

When publishing dynamic pages, the page table includes information about the incoming HTTP request. For more information, see:

http://discuss.userland.com/msgReader$247




This page was archived on 6/13/2001; 4:46:27 PM.

© Copyright 1998-2001 UserLand Software, Inc.