Hi,
Follow the steps below:
- Create a group_data subroutine in Global template:
sub {
my $tags = shift;
my $results = $tags->{results};
my $col = $tags->{column};
($results) or return;
my $last_val;
foreach (@$results) {
if(not defined $last_val or $last_val ne $_->{$col}) {
$_->{group} = 1;
$last_val = $_->{$col};
}
}
}
- Modify your search_results.html like:
.....
<%set column = 'group_field_name'%>
<%group_data%>
<%loop results%>
<%if group%><b><%group_field_name%></b><%endif%>
<%field2%>.....
<%endloop%>
.....
Cheers,
TheStone.
B.
Follow the steps below:
- Create a group_data subroutine in Global template:
sub {
my $tags = shift;
my $results = $tags->{results};
my $col = $tags->{column};
($results) or return;
my $last_val;
foreach (@$results) {
if(not defined $last_val or $last_val ne $_->{$col}) {
$_->{group} = 1;
$last_val = $_->{$col};
}
}
}
- Modify your search_results.html like:
.....
<%set column = 'group_field_name'%>
<%group_data%>
<%loop results%>
<%if group%><b><%group_field_name%></b><%endif%>
<%field2%>.....
<%endloop%>
.....
Cheers,
TheStone.
B.