Skip Navigation

[Resolved] How to set initial default dropdown View Output blank instead of all posts

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to start their search with an empty view and only show the results after the view has been filtered.

Solution:
This can be achieved by wrapping your view output content in a conditional block and then using that conditional block to check if a particular parameter is present in the URL.

Enable the advanced conditional editor for the conditional block and then add this conditional to it.

NOT ( empty( '[wpv-search-term param='wpv_view_count']') ) 

Once you've done this all you need to do is to drag your other view blocks into the conditional. The conditional will only display the results section when you've performed a search and it sees the wpv_view_count parameter.

This support ticket is created 3 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 2 replies, has 2 voices.

Last updated by ClementB7865 3 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#2195997

Tell us what you are trying to do? On page load, I would like the initial results (View Output) of dropdown filter to be blank and only populate with posts after a dropdown selection has been made. Currently the initial default is ALL posts. I've set AJAX refresh when changing any filter.

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#2196223

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Clement,

Thank you for getting in touch.

This can be achieved by wrapping your view output content in a conditional block and then using that conditional block to check if a particular parameter is present in the URL.

Enable the advanced conditional editor for the conditional block and then add this conditional to it.

 NOT ( empty( '[wpv-search-term param='wpv_view_count']') ) 

Once you've done this all you need to do is to drag your other view blocks into the conditional. The conditional will only display the results section when you've performed a search and it sees the wpv_view_count parameter.

Thanks,
Shane

#2196905

My issue is resolved now. Thank you!