Skip Navigation

[Resolved] i want no results displayed until submit is pressed

This support ticket is created 7 years, 4 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Ido Angel 7 years, 4 months ago.

Assisted by: Nigel.

Author
Posts
#459708

Hey,

I created a custom post type with field groups, then created a view for it with custom search.
Everything works perfectly - except I want the views output to display only the filtered results - meaning, at first it will display nothing except the search form, and then after filtering pressing the submit button it will show the results.

I tried to "display only search form" in the shortcode, but then i NEVER get the results.

* naturally - I DON'T want the results to appear on a different page.

Any idea?

Thanks!

Ido

#459723

Update:

I thought I could maybe try a view with pagination, and show only 1 result per page. It ALMOST worked. I mean, it works, but for some reason with this view, after I change the last parameter (year of questiuonaire) once (for example from 2006 to 2008), it never goes back to 2006.

you can see the paginated form here:

hidden link

and the unpaginated form (which shows all answers - i currently have only 2) here:

hidden link

:\

#459753

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ido

Google searches start with nothing until you give it search terms for which it retrieves results.

Views custom searches work the opposite way, more like browsing Amazon departments, in that they start with all results and narrow these down as you apply filters.

The only option whereby the search form is displayed initially with no results is to split the form and the results onto separate pages. You say that, naturally, you don't want to do this, but actually there is no other choice.

Not that your users are likely to notice that the url changes as the page updates with the search results. And on the results page the search form (including the filter settings) will also be rendered, so that users are able to update their search by adjusting the filters.

So create a page for your search and another for the search results, and then when you insert your search view into the first page using the Fields and Views button, follow the instructions for splitting the form and results on separate pages.

#459757

hey,
thanks for the reply.
the reason i don't want to do it in a different page is that the search form is within a tab within a page (or it would be, after i solve this issue).
i am thinking about 2 workarounds:

1. pagination, showing only 1 result per page. i tried this, and it ALMOST works. "almost" - because it ALWAYS shows me all results after filtering (and spreads them across pages, 1 result per page). If I could only make it show the RELEVANT results, it would be perfect.

2. some sort of jquery solution to hide the results div if there are more than 1 results in it - but i don't know jquery...

ideas?

thanks again.
ido

#459762

UPDATE:

I managed to solve this with choosing complete custom display on initial creation.
works.

thanks!
ido

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.