For more information... RTFM!
NAVIGATION
RECENTLY VIEWED
PAGES THAT LINK HERE
ACCOUNT LOGIN

You are not logged in

Powered by Interchange version 5.7.0

PageTables

Specify one or more tables to look into for pages before looking at the filesystem.

Synopsis

PageTables  table [tables...]

The parameter(s) are expected to be valid table names.

Scope

This directive is only available for use in the local (catalog.cfg) configuration file.  It will not affect any other website in any way.  This directive will not work in the global (interchange.cfg) configuration file. 

Description

This directive allows you to set up your website to serve pages from a list of database tables.

The database table(s) will be consulted, in turn, to find the page data.  If the page is not present in any of the specified database tables, then the usual filesystem-based PageDir and TemplateDir lookups will be performed.

Note

Note

In both of the following modes, the page name should be stored in the database without any suffix (i.e. "index" instead of "index.html").

Ordinary mode

"Ordinary mode" requires that your tables are set up with at least the following columns:

Name Type Index Description
code VARCHAR(50) PK Page name.
page_text TEXT Page content.

The columns can be renamed, as long as Interchange is informed, using the PageTableMap local configuration directive.

When a page is requested, the page name will be looked up using the "code" column.  If the page is found then the "page_text" will be read and displayed.  If the page is not found then the usual filesystem-based PageDir and TemplateDir lookups will be performed.

"Teleport" mode

If the $Session->{teleport} key is set to a date/time value, in "%Y%m%d%H%M%S" format, then page lookups will be slightly different from ordinary mode lookups.

"Teleport" mode requires that your tables are set up with at least the following columns:

Name Type Index Description
code INTEGER PK Unique sequence number (set to auto-increment).
base_code VARCHAR(50) MUL Page name.
page_text TEXT Page content.
show_date CHAR(14) MUL Date this page should be shown from (in "%Y%m%d%H%M%S" format).
expiration_date CHAR(14) MUL Date this page should be shown until (in "%Y%m%d%H%M%S" format).

It would be a good idea to also include a unique composite index on the "base_code", "show_date" and "expiration_date" columns.

Again, the columns can be renamed, as long as Interchange is informed, using the PageTableMap local configuration directive.

When a page is requested, the page name will be looked up using the "base_code", "show_date" and "expiration_date" columns.  If a page is found, and the "teleport" date is within range, the "page_text" will be read and displayed.  If more than one page is found to be valid, on the "teleport" date, then the page with the lowest "show_date" will be used.

Again, if the page is not found then the usual filesystem-based PageDir and TemplateDir lookups will be performed.

Note

Note

It is suggested that you decide, in advance, whether you are going to make use of "teleport" mode or not.  If you are then you need to make sure that the $Session->{teleport} key is always set for every page request (either set to the current date and time, or to a date and time to "teleport" back or forward in time).

See also

Category:  Local config directives
Last modified by: Kevin Walsh
Modification date: Tuesday 10 October 2006 at 3:43 PM (EDT)
Home  |  Legal nonsense  |  Privacy policy  |  Contact us