Navigation überspringen

[Gelöst] How to set initial default dropdown View Output blank instead of all posts

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 4 years, 7 months. 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 -

Zeitzone des Unterstützers: America/Jamaica (GMT-05:00)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von ClementB7865 vor 4 years, 7 months.

Assistiert von: Shane.

Author
Artikel
#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
Unterstützer

Sprachen: Englisch (English )

Zeitzone: 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!