Here's the final:
Create global called "error_formatted" with the following code:
require GT::SQL::Search::Base::Common;
my $tags = shift;
my $query = $IN->param('query');
if (exists $STOPWORDS->{$query}) {
return "The word '$query' is too common.";
}
if (length $query < 3) {
return "Your query is too short.";
}
return $tags->{error}; # Display default error
}
Then, edit your search.html template and replace:
<%error%>
<%endif%>
with:
<%error_formatted%>
<%endif%>
That's it!
Sean
Create global called "error_formatted" with the following code:
Code:
sub { require GT::SQL::Search::Base::Common;
my $tags = shift;
my $query = $IN->param('query');
if (exists $STOPWORDS->{$query}) {
return "The word '$query' is too common.";
}
if (length $query < 3) {
return "Your query is too short.";
}
return $tags->{error}; # Display default error
}
Then, edit your search.html template and replace:
Code:
<%if error%> <%error%>
<%endif%>
with:
Code:
<%if error%> <%error_formatted%>
<%endif%>
That's it!
Sean