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

Multi Cat Templates continued...

Quote Reply
Multi Cat Templates continued...
HI All, I'm starting a new thread for this topic, cause the other ones getting to big. To reference the first thread go to
http://www.gossamer-threads.com/scripts/forum/resources/Forum9/HTML/000466.html

I'd really love some feedback or help on this as I'm flying by the seat of my pants, but everything is coming together sloooowwwwlly.

So here's where I'm at.

I'm now able to modify my record and write the information to the database and when I select the record for modification, it shows me the data for the individual template fields. Here's the code for build_template_row

sub build_template_row {
# --------------------------------------------------------
# Returns a template row for the html form.
#

my ($name, $value, $rec) = @_;
my $select = &get_templates_list ($value, $name);
$name =~ s,-\d+$,,;

return "<tr><td align=right valign=top width=20%><font face='verdana,arial' size=2>$name</font></td><td width=80%><select name='$name'>$select</select></td></tr>\n";
}

and here's the code for get_templates_list. Note this is slightly different than get_template_list.

sub get_templates_list {
# --------------------------------------------------------
# Returns a list of all the templates (select list).
#

my ($value, $name) = @_;
my (@tpls, $tpl, $output);
opendir (TPL, "$LINKS{admin_root_path}/templates") or die "Invalid template directory: $LINKS{admin_root_path}/templates. Reason: $!";
@tpls = grep {!/^\./} readdir TPL;
closedir (TPL);
$output = '<option value="">----';
foreach $tpl (sort @tpls) {

($tpl eq $value) ? ($output .= qq~<option value="$tpl" SELECTED>$tpl~) :
($output .= qq~<option value="$tpl">$tpl~);
}
$output .= '';
return $output;
}

This is what I need:
Can anyone tell me how to incorporate the modify multiple records into this? I'm not sure what variables need to be defined. I'm assuming, I would use the same code as found in dbsql.pm
# Set the name if we are doing a multiple forms.
$opt->{'multiple'} ? ($name = "$field-${$rec}{$key}") : ($name = $field);

but I'm not sure where and how to add that line without crashing the program.

Looking forward to hearing from someone.

Kyle
Subject Author Views Date
Thread Multi Cat Templates continued... klangan 2261 Jan 11, 2000, 4:57 AM
Post Re: Multi Cat Templates continued...
klangan 2187 Jan 11, 2000, 1:16 PM
Post Re: Multi Cat Templates continued...
klangan 2187 Jan 11, 2000, 4:42 PM
Post Re: Multi Cat Templates continued...
widgetz 2649 Jan 11, 2000, 5:58 PM
Post Re: Multi Cat Templates continued...
klangan 2186 Jan 12, 2000, 2:32 PM
Post Re: Multi Cat Templates continued...
widgetz 2639 Jan 12, 2000, 6:57 PM
Post Re: Multi Cat Templates continued...
klangan 2185 Jan 12, 2000, 7:44 PM