Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Template2 - Different Category Templates Mod

Quote Reply
Template2 - Different Category Templates Mod
As my first contribution :-), these are very easy instructions to simply modify LinksSQL to use a different template for each category.

1) You need to add a field to the Category table (Table Maintenance section in the Links Manager). I called it Template2. Make sure you set the default value field to category.html.

2) Open nph-build.cgi (in admin directory) and in # Get the category info., add the following line:
Code:
$OUT{template2} = $category_r->{'Template2'};
So that it ends up reading:
Code:
# Get the category info.
%OUT = (); # Start with a clean hash.
$OUT{category_id} = $category_r->{'ID'};
$OUT{category_name} = $category_r->{'Name'};
$OUT{header} = $category_r->{'Header'};
$OUT{footer} = $category_r->{'Footer'};
$OUT{meta_name} = $category_r->{'Meta_Description'};
$OUT{meta_keywords} = $category_r->{'Meta_Keywords'};
$OUT{description} = $category_r->{'Description'};
$OUT{template2} = $category_r->{'Template2'};
$OUT{random} = rand (10000);
$OUT{random1} = rand (10000);
$OUT{random2} = rand (10000);
$OUT{random3} = rand (10000);
3) Open HTML_Templates.pm (in admin/Links directory) and in sub site_html_category, replace this:
Code:
my $output = &load_template ( 'category.html', {
For this:
Code:
my $output = &load_template ( $tags->{'Template2'}, {
After all this is done, simply make copies of category.html in your templates folder and name them according to each category and modify as you wish.
Be sure to set the contents of the field "Template2" when creating or modifying a category to the name of the template (ie. instead of category.html, category_name1.html or whatever you named it).

Good luck!


Subject Author Views Date
Thread Template2 - Different Category Templates Mod CyberLuke 10640 Oct 2, 2000, 11:35 AM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10485 Oct 2, 2000, 11:51 AM
Thread Re: Template2 - Different Category Templates Mod
CyberLuke 10473 Oct 2, 2000, 12:51 PM
Thread Re: Template2 - Different Category Templates Mod
lparry 10469 Oct 2, 2000, 10:08 PM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10467 Oct 3, 2000, 9:41 AM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10377 Oct 10, 2000, 8:22 PM
Thread Re: Template2 - Different Category Templates Mod
Stealth 10402 Oct 10, 2000, 8:42 PM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10378 Oct 10, 2000, 9:20 PM
Thread Re: Template2 - Different Category Templates Mod
Stealth 10377 Oct 10, 2000, 9:29 PM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10384 Oct 10, 2000, 9:38 PM
Post Re: Template2 - Different Category Templates Mod
Stealth 10369 Oct 10, 2000, 9:39 PM
Thread Re: Template2 - Different Category Templates Mod
RWhite 10347 Oct 11, 2000, 8:57 AM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10363 Oct 11, 2000, 9:53 AM
Post Re: Template2 - Different Category Templates Mod
RWhite 10338 Oct 11, 2000, 11:46 AM
Thread Re: Template2 - Different Category Templates Mod
campos 10329 Oct 13, 2000, 9:32 AM
Thread Re: Template2 - Different Category Templates Mod
pugdog 10337 Oct 13, 2000, 9:41 AM
Thread Re: Template2 - Different Category Templates Mod
campos 10315 Oct 13, 2000, 10:28 AM
Post Re: Template2 - Different Category Templates Mod
campos 10311 Oct 13, 2000, 10:30 AM
Post Re: Template2 - Different Category Templates Mod
pugdog 10326 Oct 13, 2000, 10:42 AM