Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: Building a New Template

Quote Reply
Re: Building a New Template In reply to
Hello everyone,

I want to incorporate my new template into page.cgi now. Here is what I've done so far:

add my ($terms_match) = $LINKS{build_terms_and_agreements} =~ m,^$LINKS{build_terms_and_agreements}/(.+),o; to the top of page.cgi under #Figure out what to look for.

add ($page =~ /^$terms_match/o) and do { &generate_terms_page ($in); last CASE; } to top of page.cgi under CASE: {

add sub generate_terms_page {
# --------------------------------------------------------
# This routine build a single page for every link.
#
my $in = shift;
my ($terms_match);

$page = $in->param('g');
($terms_match) = $LINKS{build_terms_and_agreements} =~ m,^$LINKS{build_terms_and_agreements}/(.+),o;
($id) = $page =~ m,$terms_match/(\d+),o;

if (!$id) {
print $in->header();
&site_html_error ( { error => "Sorry, I'm not sure what page you are asking for: '$page'" }, $in);
return;
}

$link = $LINKDB->get_record ($id, 'HASH');

if (!$link) {
print $in->header();
&site_html_error ( { error => "Sorry, we don't seem to have link '$id'" }, $in);
return;
}
$category = $CATDB->get_record ($link->{'CategoryID'}, 'HASH');
$title_linked = &build_linked_title ($category->{'Name'} . "/" . $link->{'Title'});

print $in->header();
print &site_html_terms_and_agreements ($link, { grand_total => $GRAND_TOTAL, title_linked => $title_linked }, $in);
}
into page.cgi

i just copied the subroutine for the detailed page and then tried to modify it with the variables I have. I can figure what needs to be edited but I would like to get help with this first. I also posted this in the same forum thread so that people can use this as a resource. Thanks!

<><------------><>
Daniel
http://www.christian-search.net
<><------------><>
Subject Author Views Date
Thread Building a New Template OneDanShow 5984 Nov 10, 2000, 11:15 AM
Thread Re: Building a New Template
OneDanShow 5908 Nov 10, 2000, 12:06 PM
Thread Re: Building a New Template
phoule 5877 Nov 15, 2000, 1:17 PM
Thread Re: Building a New Template
OneDanShow 5849 Nov 18, 2000, 10:55 AM
Thread Re: Building a New Template
pugdog 5855 Nov 18, 2000, 12:34 PM
Thread Re: Building a New Template
OneDanShow 5847 Nov 19, 2000, 2:25 PM
Thread Re: Building a New Template
phoule 5840 Nov 19, 2000, 3:08 PM
Thread Re: Building a New Template
OneDanShow 5823 Nov 19, 2000, 3:35 PM
Post Re: Building a New Template
OneDanShow 5783 Nov 25, 2000, 9:19 AM