Skip Navigation

[Resolved] Split: Move image behind search – only display results after search filter change

This support ticket is created 5 years 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 7 replies, has 2 voices.

Last updated by kjetilF 4 years, 12 months ago.

Assisted by: Minesh.

Author
Posts
#1448327

2 - Is it possible to make no results show up first? The absolutely best would be if the results appear (preferably by ajax) only when someone clicks Søk (Search) - and then pushing everything below down.

If this is possible, you'll need the login credentials. I have provided them earlier here:
https://toolset.com/forums/topic/custom-field-doesnt-show-and-some-cf-styling/

Thanks,
Kjetil

PS Minesh has helped me on a similar (block based) home page (in the thread above) but do not know when it can be finished since several issues remain. Hopefully the effort to fix this existing home page is very limited

#1448441

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Do you mean that with the following page: hidden link
- Do you want to display results only when user change the filter from the top header?

#1449491

Hi, Minesh
Sorry for my bad explanation. You are almost correct:
a - No results displayed until user has (changed filters and) clicked Søk/Search.
b - Less important: Results displayed using ajax/ without full page reload.
(The idea is to make more elements visible when opening the page, while results will fill it after an actual search 🙂

And:
c - Is it possible to make the selectors show only options with actual hits, dynamically?
For instance, if you select region (velg område) > Sardinia there are only hotels available. Anyway, in the house type (velg boligtype) selector, all house types are available.
(No problem with eg. Sardinia for now, but when we've added many houses to one region, the user easily will have no results.
If this is possible, the user instead can easily check what house types are actually available in one specific region)

Thanks again
Kjetil

#1450035

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I would need FTP access details to add some code as I do not have permission on edit the fiels on your site.

Can you please send me FTP access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1450961

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Can you please check: hidden link
- Now you can see the results only when you select the filter and click on the search button.

i've added the following code to your active theme's functions.php file:

add_filter( 'wpv_filter_query', 'func_no_results_on_load', 101, 3 );
function func_no_results_on_load( $query_args, $view_settings, $view_id ) {
     
    if ( $view_id == 56602 ) { // edit the id
		if(!isset($_GET['wpv_filter_submit'])) {
			
			$query_args['post__in']=0;
		}  
}
 
    return $query_args;
}
#1453071

Beautiful, Minesh!
Thanks a lot
This is a brilliant solution - which makes the page useful in a much better way, since many other elements can be visible on first load. Maybe an option to include in a future update of Views?

The only detail I could wish for, to make the visit more intuitive, is if it is possible to alter the text first displayed, instead of results:
"No items found"
...to something like "Adjust filters and click search to see places perfect for you" (in Norwegian, of course)
Where can I edit it?

Thanks you,
Kjetil

#1455355

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

This is a brilliant solution - which makes the page useful in a much better way, since many other elements can be visible on first load. Maybe an option to include in a future update of Views?
===>
As always, You are welcome to file a new feature request.
- https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

The only detail I could wish for, to make the visit more intuitive, is if it is possible to alter the text first displayed, instead of results:
"No items found"
...to something like "Adjust filters and click search to see places perfect for you" (in Norwegian, of course)
Where can I edit it?
===>
To change that message, please try to follow the steps shown with the following screenshot and replace the "No items found" message with your custom required text.
- hidden link

Glad to help 🙂

#1458505

My issue is resolved now. Thank you, great help as always, Minesh!