Hi, is it possible to use a different link.html for different categories?
Jan 24, 2001, 6:34 AM
Veteran (1220 posts)
Jan 24, 2001, 6:34 AM
Post #2 of 17
Views: 3592
Check out the URL below. Further down the thread you'll find some info you might find useful. It is also very useful to search the forum.
http://www.gossamer-threads.com/...ew=&sb=&vc=1
Thomas
http://www.japanreference.com
http://www.gossamer-threads.com/...ew=&sb=&vc=1
Thomas
http://www.japanreference.com
Jan 24, 2001, 7:34 AM
Veteran (1220 posts)
Jan 24, 2001, 7:34 AM
Post #5 of 17
Views: 3598
Even if you use different copies of link.html you can of course display the same values as in the original link file. Just read the thread I have posted, I think it is quite well explained.
Thomas
http://www.japanreference.com
Thomas
http://www.japanreference.com
Jan 24, 2001, 3:32 PM
Novice (26 posts)
Jan 24, 2001, 3:32 PM
Post #8 of 17
Views: 3588
Yes you code works, but I have already inserted the code that gosup said for using multiple links.html, so can I have different links.html for different catagories in search results?
So what I have got is
sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
# Set the appropriate template file to load
if ($category_name =~ "Backpacker_Hostels") {
$template_link = "link1.html"; }
elsif ($category_name =~ "Backpacker_hostels/Auckland") {
$template_link = "link2.html"; }
#all other categories use standard link template
else { $template_link = "link.html"; }
my %rec = @_;
# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ( $template_link, {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}
sub site_html_search_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
# Set the appropriate template file to load
if ($category_name =~ "Backpacker_Hostels") {
$template_link = "link1.html"; }
elsif ($category_name =~ "Backpacker_hostels/Auckland") {
$template_link = "link2.html"; }
#all other categories use standard link template
else { $template_link = "searchlink.html"; }
my %rec = @_;
# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ('searchlink.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}
but this doesnt work all the search results are using the same i.e searchlink.html
So what I have got is
sub site_html_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
# Set the appropriate template file to load
if ($category_name =~ "Backpacker_Hostels") {
$template_link = "link1.html"; }
elsif ($category_name =~ "Backpacker_hostels/Auckland") {
$template_link = "link2.html"; }
#all other categories use standard link template
else { $template_link = "link.html"; }
my %rec = @_;
# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ( $template_link, {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}
sub site_html_search_link {
# --------------------------------------------------------
# This routine is used to display what a link should look
# like.
# Set the appropriate template file to load
if ($category_name =~ "Backpacker_Hostels") {
$template_link = "link1.html"; }
elsif ($category_name =~ "Backpacker_hostels/Auckland") {
$template_link = "link2.html"; }
#all other categories use standard link template
else { $template_link = "searchlink.html"; }
my %rec = @_;
# Set new and pop to either 1 or 0 for templates.
($rec{'isNew'} eq 'Yes') ? ($rec{'isNew'} = 1) : (delete $rec{'isNew'});
($rec{'isPopular'} eq 'Yes') ? ($rec{'isPopular'} = 1) : (delete $rec{'isPopular'});
return &load_template ('searchlink.html', {
detailed_url => "$db_detailed_url/$rec{'ID'}$build_extension",
%rec,
%globals
});
}
but this doesnt work all the search results are using the same i.e searchlink.html
Jan 25, 2001, 6:16 PM
Novice (26 posts)
Jan 25, 2001, 6:16 PM
Post #14 of 17
Views: 3523
Oh what codes should I use for displaying different link.html for different catagories in a search? I have just installed the Enhanced Template and was thinking I could use "if" codes but am not sure how I could do this.. like if there is a url then the <ul> tag is inplace if not no <ul> if hits the hits are displayed if not etc... would this work?