Skip Navigation

[Resolved] I would like a search on the home page that goes to the main directory page

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 8 replies, has 2 voices.

Last updated by Minesh 3 months, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2748744
search-in-home-page-banner.jpg

Tell us what you are trying to do?

I have a view on my directory page that includes a search. I would like to also have some search functionality on the home page that takes you to the same directory page for the results. BUT I don't want the same search layout on each page.

Is there any documentation that you are following?

https://toolset.com/course-lesson/displaying-search-results-on-a-different-page/

Is there a similar example that we can see?

On this site there is a simple search in the home page header: hidden link that then takes you to the more full-featured search page: hidden link

I can't see how to do this with Toolset because I think I would have to have the same search fields o both pages? I have thought about just hiding some search/filter fields with CSS on the home page but it means having them in specific places on the main search that doesn't really work.

What is the link to your site?

Directory page: hidden link

I want to keep the search area on this page as it is and in the home page banner just have the following laid out in a row:

Search by location Search by region Capacity Search Now (image attached)

And it take people to the above directory page for the results.

#2749162

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I would like to know - how exactly you build your search view? Are you using blocks or legacy view?

#2749187

Hi Minesh. I have built it with blocks. Thanks, Lucy

#2749202

Minesh
Supporter

Languages: English (English )

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

Ok - in that case, you should try to add conditional block.

First navigate to: Toolset => Settings => Front-end Content tab and add the is_front_page function name within section "Functions inside conditional evaluations".

Once you register the function name is_front_page, edit your view where you added custom search filters and then add the conditional block and select "Custom function" and further select is_front_page function name and compare with static value 1 and add the condition. Please check the following screenshot:
- hidden link

Now within this conditional blocks add the filters you want to display when home page is displayed.
Add another conditional block and check when home page is static value 0 and add other search filters you would like to have.

More info:
=> https://toolset.com/course-lesson/using-toolset-conditional-block/

I hope this will help you to display different filters when home page is displayed and when you are on another page.

#2749215

I have actually come across another problem in trying to test that.

Firstly, I am using Elementor for the home page and the Toolset View widget doesn't seem to allow me to edit the view as required by these instructions: https://toolset.com/course-lesson/displaying-search-results-on-a-different-page/

Secondly, I tried to do it on a test page using the block editor here: hidden link

I can specify show search only but when I select 'display the results on another page' it does not allow me to select the 'our venues' page where the original view is.

#2749238

Minesh
Supporter

Languages: English (English )

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

Can you please share details what view you want to use and where you added those conditional statements I mentioned and what you want to display with home page and on what page you want to display different search filters with results.

*** 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.

#2749273

Minesh
Supporter

Languages: English (English )

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

I see you already set many conditional display and you have many search filters added on the following page:
- hidden link

I need to know what are the exact search filters with names you want to display on the home page?

#2749281

Hi Minesh

Yes, the search filters turn off the fields I don't want on the home page.

So I do want to display Regions (labelled Search by region), Locations (labelled Search by location), Search Capacity (labelled Capacity) and the Submit button.

Thanks
Lucy

#2749287

Minesh
Supporter

Languages: English (English )

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

I've added the Elementor's Text module and I've added the following shortcode to it:

[wpv-form-view name="venue-list-copy-1725298728" target_id="27"]

You can work on some CSS to make it look it better. I hope the above solution help you to fix the issue.

#2749332

Fantastic service as always. I've added the CSS and it looks great and does exactly what I want. Thank you so much for your help.

Best wishes
Lucy