Hello
Can anyone tell me how to set up links so a link can be assigned to multiple categories? That would require a multiple select box to be generated for the "Categories" field in the "links.db" form pages.
Can this be done using "links.def" settings, or must one edit db_utils.pl?
I see that the "Related" Field in the "Categories" database uses a multiple select box and can handle multiple category options.
Below are the bits of code in db_utils.pl that appear to do this for the "Related" field.
sub build_select_field at line 176
#####
if (! exists $db_select_fields {$column}) {
$db_select_fields{$db_cols[$db_category]} \
= $db_select_fields{'Mult-Related'} = join (",", &category_list);
}
####
## and again in sub build_html_record_form
## at line 308
# Go through a little hoops to only
# load category list when absolutely
# neccessary.
if ($in{'db'} eq 'links') {
exists $db_select_fields{$db_cols [$db_category]} or \
($db_select_fields{$db_cols [$db_category]} = join (",", &category_list));
}
else {
$db_select_fields{'Related'} or ($db_select_fields{'Related'} = \
$db_select_fields{'Mult-Related'} = join ",", &category_list);
}
Can anyone suggest the correct links.def syntax or the correct changes to make to db_utils.pl.
Am I looking at the wrong pieces of code? What have I missed?
Thanks in advance
Don
[This message has been edited by Don (edited February 02, 1999).]
[This message has been edited by Don (edited February 02, 1999).]
Can anyone tell me how to set up links so a link can be assigned to multiple categories? That would require a multiple select box to be generated for the "Categories" field in the "links.db" form pages.
Can this be done using "links.def" settings, or must one edit db_utils.pl?
I see that the "Related" Field in the "Categories" database uses a multiple select box and can handle multiple category options.
Below are the bits of code in db_utils.pl that appear to do this for the "Related" field.
sub build_select_field at line 176
#####
if (! exists $db_select_fields {$column}) {
$db_select_fields{$db_cols[$db_category]} \
= $db_select_fields{'Mult-Related'} = join (",", &category_list);
}
####
## and again in sub build_html_record_form
## at line 308
# Go through a little hoops to only
# load category list when absolutely
# neccessary.
if ($in{'db'} eq 'links') {
exists $db_select_fields{$db_cols [$db_category]} or \
($db_select_fields{$db_cols [$db_category]} = join (",", &category_list));
}
else {
$db_select_fields{'Related'} or ($db_select_fields{'Related'} = \
$db_select_fields{'Mult-Related'} = join ",", &category_list);
}
Can anyone suggest the correct links.def syntax or the correct changes to make to db_utils.pl.
Am I looking at the wrong pieces of code? What have I missed?
Thanks in advance
Don
[This message has been edited by Don (edited February 02, 1999).]
[This message has been edited by Don (edited February 02, 1999).]

