Yes...it is.
Do the following (which are adapted from the ROOT Build/Category Build FAQ/Tutorial located at
www.anthrotech.com/cgi/links/faqs/rootbuild/ ):
1) Add the following variable in your
links.cfg file:
Code:
$build_second_root_path = "/absolute/path/to/english";
$build_second_root_url = "http://surfootball.com/english";
2) Add the following sub-routine in your
db_utils.pl file:
Code:
sub build_sec_dir {
# --------------------------------------------------------
# Verifies that all necessary directories to build category pages.
my $input = shift;
my ($dir, $path) = '';
my @dirs = split /\//, $input;
foreach $dir (@dirs) {
$path .= "/$dir";
&build_check_dir ($build_second_root_path, $path);
if (! (-e "$build_second_root_path$path")) {
print "\tMaking Directory ($build_dir_per): '$build_second_root_path$path' ...";
if (mkdir ("$build_second_root_path$path", "$build_dir_per")) {;
print "Made. CHMOD ($build_dir_per) ...";
if (chmod ($build_dir_per, "$build_second_root_path$path")) {;
print "Done.";
}
else { print "CHMOD ($build_dir_per) failed! Reason: $!."; }
}
else { print "mkdir failed! Reason: $!."; }
print "\n";
}
}
return "$build_second_root_path$path";
}
3) Then add the following codes in your
sub build_staggered routine in the
nph-build.cgi file:
Code:
$t1 = time();
print "** Creating Second Home Page . . .\n";
&build_second_home_page;
print "** Done (", time - $t1, " s)!\n\n";
AFTER the following codes:
Code:
$t1 = time();
print "** Creating Home Page . . .\n";
&build_home_page;
print "** Done (", time - $t1, " s)!\n\n";
4) Then add the following codes in your
sub build_all routine in the
nph-build.cgi file:
Code:
# Create Second Home Page
$use_html ?
print qq|Building <A HREF="$build_second_root_url/$build_index">Second Home Page</A> . . .\n| :
print qq|Building Second Home Page . . .\n|;
&build_second_home_page;
print "\tDone\n\n";
AFTER the following codes:
Code:
# Create Home Page
$use_html ?
print qq|Building <A HREF="$build_root_url/$build_index">Home Pages</A> . . .\n| :
print qq|Building Home Page . . .\n|;
&build_home_page;
print "\tDone\n\n";
4) Then add the following sub-routine after the
sub build_home_page routine:
Code:
sub build_second_home_page {
# --------------------------------------------------------
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_second_root_path/$build_index\n";
open (HOME, ">$build_second_root_path/$build_index") or &cgierr ("unable to open second home page: $build_second_root_path/$build_index. Reason: $!");
$category = &site_html_print_cat (@rootcat) if ($#rootcat >= 0);
$total = $grand_total;
print HOME &site_html_second_home;
close HOME;
print "\tClosing page.\n";
}
5) Create the following sub-routine in your
site_html_templates.pl file:
Code:
sub site_html_second_home {
# --------------------------------------------------------
# This routine will build a home page. It is not meant to have any
# links on it, only subcategories.
return &load_template ('second_home.html', {
category => $category,
grand_total => $grand_total,
%globals
});
}
6) Create a new template file called
second_home.html file. This should be a copy of your
home.html with the same tags that you use in that template file.
7) Create a global tag called
build_second_root_url in the
%globals section of your
site_html_templates.pl file:
Code:
build_second_root_url => $build_second_root_url
8) Then in your
home.html file, add the following link:
Code:
<a href="<%build_second_root_url%>">English Page</a>
NOW...if you want a secondary level of category pages...I would suggest using the codes found in the above mentioned FAQ/Tutorial that I linked. The code hack I have just provided will only create a second home page NOT a second set of category pages.
Regards,
------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com * Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.
[This message has been edited by AnthroRules (edited May 08, 2000).]