Gossamer Forum
Home : Products : Gossamer Links : Discussions :

multiple categories

Quote Reply
multiple categories
Links had a hack where you can make our own templates and import them the the code was something like this:


sub site_html_category {
# --------------------------------------------------------
# This rountine will build a page based for the current category.
my $template;
# Set the appropriate template file to load
if ($category_name =~ /^Entertainment/) {
$template = "Entertainment.html"; }
elsif ($category_name =~ /^Gameroom/) {
$template = "Gameroom.html"; }
elsif ($category_name =~ /^Health_and_Fitness/) {
$template = "Health.html"; }
elsif ($category_name =~ /^Business_and_Economy/) {
$template = "Business.html"; }
elsif ($category_name =~ /^Home_and_Garden/) {
$template = "Garden.html"; }
elsif ($category_name =~ /^Automotive/) {
$template = "Automotive.html"; }
elsif ($category_name =~ /^Art_and_Humanities/) {
$template = "Art.html"; }
elsif ($category_name =~ /^Education/) {
$template = "Education.html"; }
elsif ($category_name =~ /^Computer_and_Internet/) {
$template = "Computer.html"; }
elsif ($category_name =~ /^Food_And_Drink/) {
$template = "Food.html"; }
elsif ($category_name =~ /^Government/) {
$template = "Government.html"; }
elsif ($category_name =~ /^Kids_and_Family/) {
$template = "Kids.html"; }
elsif ($category_name =~ /^Reference/) {
$template = "Reference.html"; }
elsif ($category_name =~ /^Society_and_Culture/) {
$template = "Culture.html"; }
elsif ($category_name =~ /^Science/) {
$template = "Science.html"; }
else { $template = "category.html"; }


do they have a hack for links sql? and how can I import my links ones into links sql?


Tazmear

www.sagnetwork.com - Internet Portal
Quote Reply
Re: [tazmear] multiple categories In reply to
This is actually a field in the Category table in LinksSQL.

You would need to run these through SQL monitor to get them into the table. Something like this:

UPDATE Category SET Category_Template = 'Entertainment.html' WHERE Full_Name LIKE 'Entertainment%'

Edit: Actually I think you may only need to set these in the root categories - I have a feeling the sub categories automatically use the template from the parents - but I'm not certain.

Last edited by:

afinlr: May 1, 2004, 3:44 PM
Quote Reply
Re: [afinlr] multiple categories In reply to
 
www.sagnetwork.com - Internet Portal
Quote Reply
Re: [afinlr] multiple categories In reply to
You would need to run these through SQL monitor to get them into the table. Something like this:

UPDATE Category SET Category_Template = 'Entertainment.html' WHERE Full_Name LIKE 'Entertainment%'


so all i have to do is make each line like this?

UPDATE Category SET Category_Template = 'Entertainment.html' WHERE Full_Name LIKE 'Entertainment%'
UPDATE Category SET Category_Template = 'Art.html' WHERE Full_Name LIKE 'Art%'
UPDATE Category SET Category_Template = 'Science.html' WHERE Full_Name LIKE 'Science%'
www.sagnetwork.com - Internet Portal
Quote Reply
Re: [tazmear] multiple categories In reply to
Yes, I think so. Try it with one and see whether it works before you go for the whole lot.
Quote Reply
Re: [afinlr] multiple categories In reply to
Afinlr,

where is SQL monitor located? and thanks 4 your help.


Tazmear
www.sagnetwork.com - Internet Portal
Quote Reply
Re: [tazmear] multiple categories In reply to
Admin->Database and then it's in the left-hand column.

Note that if you have a prefix on your tables you'll need to add it before Category - e.g. lsql_Category