Not out of the box no. You could do something like:
# -----------------------------------------
# Generate a dropdown list of categories.
#
my $db = new Links: BSQL $LINKS{admin_root_path} . "/defs/Category.def";
my $cats = $db->query ( { ID => '*', sb => 'Name' } );
my $output = '';
if ($db->hits) {
$output = '<SELECT NAME="Category">
foreach my $cat (@$cats) {
$cat = $db->array_to_hash($cat);
$output .= "<OPTION>" . $cat->{Name};
}
$output .= "</SELECT>";
}
else {
$output = "Sorry, we don't have any categories.";
}
return $output;
}
and put that in HTML_Templates.pm. Then add category_list => \&category_dropdown in your GLOBALS list. Then you can use <%category_list%> wherever you like to generate a select list.
Hope that helps,
Alex
Code:
sub category_dropdown { # -----------------------------------------
# Generate a dropdown list of categories.
#
my $db = new Links: BSQL $LINKS{admin_root_path} . "/defs/Category.def";
my $cats = $db->query ( { ID => '*', sb => 'Name' } );
my $output = '';
if ($db->hits) {
$output = '<SELECT NAME="Category">
foreach my $cat (@$cats) {
$cat = $db->array_to_hash($cat);
$output .= "<OPTION>" . $cat->{Name};
}
$output .= "</SELECT>";
}
else {
$output = "Sorry, we don't have any categories.";
}
return $output;
}
and put that in HTML_Templates.pm. Then add category_list => \&category_dropdown in your GLOBALS list. Then you can use <%category_list%> wherever you like to generate a select list.
Hope that helps,
Alex