Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Re: [hairy] Adding to a design template

Quote Reply
Re: [hairy] Adding to a design template In reply to
OK, but it takes a bit...

In link.cfg, you need both of these:

$build_index = "index.html";
$build_index1 = "index1.html";


In site_html_templates.pl, paste the sub below under the existing sub site_html_home:



sub site_html_home1 {
# --------------------------------------------------------
# This routine will build a home page. It is not meant to have any
# links on it, only subcategories.

return &load_template ('home1.html', {
category => $category,
grand_total => $grand_total,
%globals
});
}

Make sure the name of the template matches what you have in the template directory. Next, in nph-build.cgi, under sub build_all, paste this under the current Create Home Page:

# Create Home Page1
$use_html ?
print qq|Building <A HREF="$build_root_url/$build_index">Home Page1</A> . . .\n| :
print qq|Building Home Page1 . . .\n|;
&build_home_page1;
print "\tDone\n\n";

Further down in nph-build, paste this sub under the existing sub build_home_page:

sub build_home_page1 {
# --------------------------------------------------------
my ($subcat, @rootcat);
local ($total);

# Check to see which categories are off of the root.
foreach $subcat (sort keys %category) {
if ($subcat =~ m,^([^/]*)$,) {
push (@rootcat, $subcat);
}
}
print "\tSubcategories: "; print $#rootcat+1; print "\n";
print "\tTotal Links: $grand_total\n";
print "\tOpening page: $build_root_path/$build_index1\n";

open (HOME, ">$build_root_path/$build_index1") or &cgierr ("unable to open home page: $build_root_path/$build_index1. Reason: $!");
$category = &site_html_print_cat (@rootcat) if ($#rootcat >= 0);
$total = $grand_total;
print HOME &site_html_home1;
close HOME;
print "\tClosing page.\n";
}

That should pretty much do it... As always, make sure you have a backup of everything... Ya know, it would probably be easier to just copy your whole Links script into a file names Links2, change the names in links.cfg to match that, and practice your mods using that...


Leonard
aka PerlFlunkie

Last edited by:

PerlFlunkie: Nov 21, 2003, 9:44 AM
Subject Author Views Date
Thread Adding to a design template hairy 5342 Nov 20, 2003, 10:42 AM
Thread Re: [hairy] Adding to a design template
PerlFlunkie 5239 Nov 20, 2003, 12:13 PM
Thread Re: [PerlFlunkie] Adding to a design template
hairy 5246 Nov 20, 2003, 12:20 PM
Thread Re: [hairy] Adding to a design template
esm 5215 Nov 20, 2003, 4:25 PM
Thread Re: [esm] Adding to a design template
hairy 5185 Nov 20, 2003, 4:38 PM
Thread Re: [hairy] Adding to a design template
PerlFlunkie 5183 Nov 20, 2003, 11:01 PM
Thread Re: [PerlFlunkie] Adding to a design template
hairy 5180 Nov 21, 2003, 4:09 AM
Thread Re: [hairy] Adding to a design template
PerlFlunkie 5178 Nov 21, 2003, 9:39 AM
Post Re: [PerlFlunkie] Adding to a design template
hairy 5173 Nov 21, 2003, 11:30 AM