0

I have a page that displays a map with results based on an exposed search field, which is a required field.

I would like to display a custom view when the user visits the page and has not yet entered anything into the field - similar to this question but another view rather than a custom result set. At the moment, the map shows all results when the page is first loaded, and I can't figure out how to change that behaviour.

I know that if I set the form to "Input required" I can enter custom text to be shown before the form is submitted, but I'd like to go a step further and be able to set a custom view to be shown much like the "No results behaviour" option.

Interestingly, with a "no results" view set, I can submit the form with an empty search field and my custom view will show. This is what I also need to be shown before anything has been submitted.

Is there a configuration where this is possible in views, or any way this can be achieved in code?

0

Looks like the required_filter_input module is the way to go, as it requires one exposed filter to have a value before returning results, which triggers the custom "no results" view without any input by default.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.