Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Globals question ? Need Help

Quote Reply
Globals question ? Need Help
I found a reply by Alex for using multiple add.html templates for different categories using globals.

I would like to modify this to use it for multiple detailed.html pages for different categories.

Here you can see it:

custom_form =>
sub {
my $tags = shift;
my $query = $tags->{query};
my ($full_name) = $DB->table('Category')->select(['Full_Name'], { ID => $tags->{ID} })->fetchrow;
my $file = '';
if ($full_name =~ /^Automobiles/) {
$file = 'add_auto.html';
elsif ($full_name =~ /^Announce/) {
$file = 'add_announce.html';
else {
$file = 'include_form.html';
open (FILE, "/path/to/admin/templates/default/$file");
read (FILE, my $data, -s FH);
close FILE;
return $data;
What would I need to modify to get this to work for me ?Heres where the full messages can be seen:http://www.gossamer-threads.com/...orum.cgi?post=175865;Thanks