Check for no search results

phil88 - January 11, 2008 - 20:23
Project:Views Fast Search
Version:5.x-1.x-dev
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

How is it possible to show the user that no results were found ? Currently, is shows a blank page, no results.

Thanks for the help,
Phil

#1

MrKatz - January 18, 2008 - 15:59

Go to Administer / Site building / views.

Select 'edit' views_fastsearch.

Under page you will found a option 'empty text'.

This text will only be displayed if a view returns no nodes or in this case no search result!

alex

#2

doc2@drupalfr.org - January 24, 2008 - 11:21
Status:active» closed

Oups, I shouldn't have close this...

The problem of this method is that the "no results" message is displayed as soon as the view shows up, while no search has yet been made...

Any workaround?

#3

doc2@drupalfr.org - January 24, 2008 - 11:23
Status:closed» active

#4

douggreen - January 24, 2008 - 13:25

@doc2, I presume that you're referring to a standard view with an exposed filter, and that the "no results" message displays on the view page before any exposed filter options have been submitted. I haven't setup a test case for this, but don't think that I've seen this problem before. Could you please elaborate on exactly what you're doing. What options are you using for the "search" filter in the view.

#5

doc2@drupalfr.org - January 30, 2008 - 16:14

Hi Doug,

This is as simple as what you wrote:

referring to a standard view with an exposed filter, and that the "no results" message displays on the view page before any exposed filter options have been submitted.

Actually, I get the problem with the default search/fast view cloned with just an added "no result" empty text.

You said:

I haven't setup a test case for this, but don't think that I've seen this problem before.

I don't think this is an isolated case (drupalers, anything to say?!)

Thus, considering the need for a "no result" message in case of "no result" only, that is to say the case for any fastsearch view with a "no result" empty text, is there just a simple view setting to make that I missed?

About

Could you please elaborate on exactly what you're doing. What options are you using for the "search" filter in the view.

I get the problem both on a cloned default view of fastsearch and on a custom view using the fastsearch view_field. This is independent from my other post. Yet it is still effectively assigned to the 5.x-1.x-dev version.

I'll try the 5.x-2.x-dev version but I don't feel confident as there are no public release notes or any other kind of info about it...

#6

PepeMty - December 27, 2008 - 18:54

Hello all!

I have this exact problem. Any advance here? Any workaround, please?

José

#7

eliza411 - December 31, 2008 - 17:33

I work around this by evaluating the URL to see if a search has been performed. In the empty text, change the Input type to PHP and do the following:

<?php
if('/view/url/whenempty' === request_uri()) {
return;
} else {
?>

<p>Your search did not return any results.</p>
<?php } ?>

 
 

Drupal is a registered trademark of Dries Buytaert.