The CyberFair Site’s Architecture
The architecture that our site’s design team had worked out looked something like the diagram in Figure 15-1. Besides a few top-level pages, the bulk of the site was to consist of two kinds of pages: leader profiles, grouped into a number of categories (like “Government,” “School,” etc.), and student pages, grouped according to classroom.
Figure 15-1. Site architecture for the CyberFair entry
So, in terms of automatically generated links, we needed to produce the following:
Links from the “who made this site” page to each classroom page
Links from each classroom page to each student page for that classroom
Links from each student page to the classroom page for that class
Links from each student’s page to any leader pages that the student was involved in creating
Links from each leader category page to the leader pages that fell under that category
Links from each leader page to the category page that the leader fell under
Links from each leader page to the pages of the students who were involved in creating it
To generate those links, the make_cf.plx
script needed to traverse the
site’s pages twice: once to read all the pages and build up a
data structure based on their metainformation, and the second time to
rewrite each page with links to all the other pages in the structure.
Example 15-1 gives an updated version of
make_cf.plx
that can do that. ...
Get Perl for Web Site Management now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.