It is possible by using one of the following methods:
1) Hack sub site_html_link in HTML_Templates.pm
if ($rec->{'CategoryID'} eq '19') {
$template = "link2.html";
}
else {
$template = "link.html";
}
Then replace link.html with $template in the following codes:
my $output = &load_template ('link.html', {
Like the following:
my $output = &load_template ($template, {
Then create another template file called link2.html.
NOW, if you want to check the CategoryID field with the actual category name, then you will have to use the following codes:
my $catname = &Links::DB_Utils::get_category_name($rec->{CategoryID});
if ($catname eq 'Something') {
$template = "link2.html";
}
else {
$template = "link.html";
}
2) Hack the sub build_category_pages in the nph-build.cgi file
Replace the following codes:
$OUT{links} .= &site_html_link ($tmp);
with the following codes:
if ($OUT{category_name} eq 'Something') {
$OUT{links2} .= &site_html_link2 ($tmp);
}
else {
$OUT{links} .= &site_html_link ($tmp);
}
Note: There are a bunch of these codes in the subroutine, so you need to edit all of them.
You will also need to create another subroutine in the HTML_Templates.pm file called sub site_html_link2 and this subroutine should load link2.html.
Then in your category.html template file, you need to add the following codes:
<%if links2%>
<%links2%>
<%endif%>
Hope these suggestions help.
Regards,
Eliot Lee
1) Hack sub site_html_link in HTML_Templates.pm
Code:
if ($rec->{'CategoryID'} eq '19') {
$template = "link2.html";
}
else {
$template = "link.html";
}
Then replace link.html with $template in the following codes:
Code:
my $output = &load_template ('link.html', {
Like the following:
Code:
my $output = &load_template ($template, {
Then create another template file called link2.html.
NOW, if you want to check the CategoryID field with the actual category name, then you will have to use the following codes:
Code:
my $catname = &Links::DB_Utils::get_category_name($rec->{CategoryID});
if ($catname eq 'Something') {
$template = "link2.html";
}
else {
$template = "link.html";
}
2) Hack the sub build_category_pages in the nph-build.cgi file
Replace the following codes:
Code:
$OUT{links} .= &site_html_link ($tmp);
with the following codes:
Code:
if ($OUT{category_name} eq 'Something') {
$OUT{links2} .= &site_html_link2 ($tmp);
}
else {
$OUT{links} .= &site_html_link ($tmp);
}
Note: There are a bunch of these codes in the subroutine, so you need to edit all of them.
You will also need to create another subroutine in the HTML_Templates.pm file called sub site_html_link2 and this subroutine should load link2.html.
Then in your category.html template file, you need to add the following codes:
Code:
<%if links2%>
<%links2%>
<%endif%>
Hope these suggestions help.
Regards,
Eliot Lee