NAME
CGI::WPM::MultiPage - Demo of HTML::Application that resolves navigation for one level in the web site page hierarchy from a parent node to its children, encapsulates and returns its childrens' returned web page components, and can make a navigation bar to child pages.
DEPENDENCIES
Perl Version
5.004
Standard Modules
I<none>
Nonstandard Modules
HTML::Application 0.4
CGI::WPM::Base 0.4
SYNOPSIS
An example configuration file for a multiple-page website
my $rh_preferences = {
page_header => <<__endquote,
__endquote
page_footer => <<__endquote,
<P><EM>Sample Web Site was created and is maintained for personal use by
Darren Duncan. All content and source code was
created by me, unless otherwise stated. Content that I did not create is
used with permission from the creators, who are appropriately credited where
it is used and in the Works Cited section of this site.</EM></P>
__endquote
page_css_code => [
'BODY {background-color: white; background-image: none}'
],
page_replace => {
__graphics_directories__ => 'http://www.sampleweb.net/graphics_directories',
__graphics_webring__ => 'http://www.sampleweb.net/graphics_webring',
},
vrp_handlers => {
external => {
wpm_module => 'CGI::WPM::Redirect',
wpm_prefs => {},
},
frontdoor => {
wpm_module => 'CGI::WPM::Static',
wpm_prefs => { filename => 'frontdoor.html' },
},
intro => {
wpm_module => 'CGI::WPM::Static',
wpm_prefs => { filename => 'intro.html' },
},
whatsnew => {
wpm_module => 'CGI::WPM::Static',
wpm_prefs => { filename => 'whatsnew.html' },
},
timelines => {
wpm_module => 'CGI::WPM::Static',
wpm_prefs => { filename => 'timelines.html' },
},
indexes => {
wpm_module => 'CGI::WPM::Static',
wpm_prefs => { filename => 'indexes.html' },
},
cited => {
wpm_module => 'CGI::WPM::MultiPage',
wpm_subdir => 'cited',
wpm_prefs => 'cited_prefs.pl',
},
mailme => {
wpm_module => 'CGI::WPM::MailForm',
wpm_prefs => {},
},
guestbook => {
wpm_module => 'CGI::WPM::GuestBook',
wpm_prefs => {
custom_fd => 1,
field_defn => 'guestbook_questions.txt',
fd_in_seqf => 1,
fn_messages => 'guestbook_messages.txt',
},
},
links => {
wpm_module => 'CGI::WPM::Static',
wpm_prefs => { filename => 'links.html' },
},
webrings => {
wpm_module => 'CGI::WPM::Static',
wpm_prefs => { filename => 'webrings.html' },
},
},
def_handler => 'frontdoor',
menu_items => [
{
menu_name => 'Front Door',
menu_path => '',
is_active => 1,
}, {
menu_name => 'Welcome to SampleWeb',
menu_path => 'intro',
is_active => 1,
}, {
menu_name => "What's New",
menu_path => 'whatsnew',
is_active => 1,
}, 1, {
menu_name => 'Story Timelines',
menu_path => 'timelines',
is_active => 1,
}, {
menu_name => 'Issue Indexes',
menu_path => 'indexes',
is_active => 1,
}, {
menu_name => 'Works Cited',
menu_path => 'cited',
is_active => 1,
}, {
menu_name => 'Preview Database',
menu_path => 'dbprev',
is_active => 0,
}, 1, {
menu_name => 'Send Me E-mail',
menu_path => 'mailme',
is_active => 1,
}, {
menu_name => 'Guest Book',
menu_path => 'guestbook',
is_active => 1,
}, 1, {
menu_name => 'External Links',
menu_path => 'links',
is_active => 1,
}, {
menu_name => 'Webrings',
menu_path => 'webrings',
is_active => 1,
},
],
menu_cols => 4,
# menu_colwid => 100,
menu_showdiv => 0,
# menu_bgcolor => '#ddeeff',
page_showdiv => 1,
};
DESCRIPTION
This Perl 5 object class is part of a demonstration of HTML::Application in use. It is one of a set of "application components" that takes its settings and user input through HTML::Application and uses that class to send its user output. This demo module set can be used together to implement a web site complete with static html pages, e-mail forms, guest books, segmented text document display, usage tracking, and url-forwarding. Of course, true to the intent of HTML::Application, each of the modules in this demo set can be used independantly of the others.
SYNTAX
This class does not export any functions or methods, so you need to call them using object notation. This means using Class->function() for functions and $object->method() for methods. If you are inheriting this class for your own modules, then that often means something like $self->method().
PUBLIC FUNCTIONS AND METHODS
main( GLOBALS )
You invoke this method to run the application component that is encapsulated by this class. The required argument GLOBALS is an HTML::Application object that you have previously configured to hold the instance settings and user input for this class. When this method returns then the encapsulated application will have finished and you can get its user output from the HTML::Application object.
PREFERENCES HANDLED BY THIS MODULE
This POD is coming when I get the time to write it.
vrp_handlers # match wpm handler to a vrp
def_handler # if vrp undef, which handler?
menu_items # items in site menu, vrp for each
menu_cols # menu divided into n cols
menu_colwid # width of each col, in pixels
menu_showdiv # show dividers btwn menu groups?
menu_bgcolor # background for menu
menu_showdiv # show dividers btwn menu groups?
page_showdiv # do we use HRs to sep menu?
PROPERTIES OF ELEMENTS IN vrp_handlers HASH
wpm_module # wpm module making content
wpm_subdir # subdir holding wpm support files
wpm_prefs # prefs hash/fn we give to wpm mod
PROPERTIES OF ELEMENTS IN menu_items ARRAY
menu_name # visible name appearing in site menu
menu_path # vrp used in url for menu item
is_active # is menu item enabled or not?
AUTHOR
Copyright (c) 1999-2001, Darren R. Duncan. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. However, I do request that this copyright information remain attached to the file. If you modify this module and redistribute a changed version then please attach a note listing the modifications.
I am always interested in knowing how my work helps others, so if you put this module to use in any of your own code then please send me the URL. Also, if you make modifications to the module because it doesn't work the way you need, please send me a copy so that I can roll desirable changes into the main release.
Address comments, suggestions, and bug reports to perl@DarrenDuncan.net.
SEE ALSO
perl(1), HTML::Application, CGI::WPM::Base.