Skip Navigation

[Resolved] I need help creating a customized search.

This support ticket is created 3 years, 10 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
- 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 14 replies, has 2 voices.

Last updated by Kegan 3 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#1952741

Tell us what you are trying to do?
I am trying to set up a custom search. So I installed the Real Estate Reference Site since it seemed like it had the setup that was closest to what I need. Particularly, I need to be able to filter records by State and then by either City, County, or Region/Area. Unfortunately, I am not finding documentation that helps me to understand and customize the built-in State and City search function.

Is there any documentation that you are following?
I have searched for detailed instructions for how to build the custom search in the real estate reference site:
- https://toolset.com/lesson-placement/lesson-placements-1824669-1621213/
- https://toolset.com/2014/06/learn-build-flexible-parametric-searches/
- https://toolset.com/documentation/legacy-features/views-plugin/front-page-filters/
- https://toolset.com/forums/topic/i-want-to-make-custom-search-in-detail-using-toolset/#post-1778529

While I am going through the WordPress Real Estate Sites Course (https://toolset.com/course/wordpress-real-estate-sites/), I am not seeing detailed instructions about how to create the example website from scratch.

Is there some step-by-step instruction available that I could follow to reproduce the Real Estate reference site?

Is there a similar example that we can see?
https://discover-wp.com/site-types/cb-properties-real-estate-site/

What is the link to your site?
hidden link

#1953229

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Here is the Doc about how you can filter by related posts:
=> https://toolset.com/documentation/legacy-features/views-plugin/how-to-filter-by-related-posts/

The doc is for classic view, however the filter used will be the same.

#1954605
States-Cities-Selector.jpg

Thank you for your response.

I have read through the page you sent me many times and tried to carry out the instructions. Unfortunately, I still don't see how to recreate the search options that are currently part of the Real Estate Reference Site.

Could you please provide step-by-step instructions (using the current version of Toolset and WordPress Gutenburg blocks) to recreate just the State and City ancestor search function, based on a fresh install of the 'Real Estate Reference Site'.

All I want to do is be able to create the exact Search fields for City and State as is already set up in the Reference Site.

#1954615
Search-Field-Selector.jpg

This is a screenshot of what I am seeing when I have added a Search Field

#1955405

Minesh
Supporter

Languages: English (English )

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

Have you created One to Many post relationship with State and City?

Can you please share problem URL where you are trying to build your block view as well as temporary admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) 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.

#1955691

All I want to know is the exact step-by-step process for how to set up the State and City search function that is already set up when I install a fresh install of the Real Estate Reference Site. I just want to manually make an exact copy of those custom search fields.

That process should not be any different for my install so I do not see why you need access to my install.

The City and State one-to-one relationship is already set up when I installed the Real Estate Reference Site.

Please just tell me what the steps are to duplicate the custom search box for State and City.

#1955697

I do not need help fixing anything. I simply want to learn how to create the search field.

#1955699

Minesh
Supporter

Languages: English (English )

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

Ok - based on the screenshot you shared I can see you are using Block mode to create the custom search view. Can you please confirm as we can create custom search using classic view mode as well.

#1955729

Minesh
Supporter

Languages: English (English )

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

As you can see with the following screenshot: hidden link
- We have two post relationship:
- State Cities (once state can have many cities)
- Cities Properties (one city can have many properties)

Considering now, I want to build the custom search for Properties post type and I want to filter my properties using Cities and States. I will create a custom search view for post type Properties.

As you can see with the following screenshot: hidden link
- I've created custom search view for post type properties and now I'll add the custom search fields by clicking on button "Add Search Field".

Please check the following video I prepare for you:hidden link

And see on this page now State/City filter is working:
- hidden link

Please note that View's "Custom Search Settings" is set to "AJAX refresh when changing any filter".
-Screenshot: hidden link

#1957811

Minesh
Supporter

Languages: English (English )

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

I'm not sure how you are creating the view.

Here is the test page I created with custom search which have State/City filter.
- hidden link

Here is the admin link:
- hidden link

I just login to your site and added a new page and to that page added a view block and created a new view and selected the "Properties" as post type to display with this view and added the filters the same way I shown with the video I shared. I can see its working as expected.

#1958675
Select a Field dropdown - 2021-02-19_11-15-29.jpg

I can see that you were able to create the 'State' and 'City' search field set on the 'Toolset Test Page' that you created. Unfortunately, I am still unable to duplicate what you did.

I am not sure what I am doing wrong. I just tried to replicate the search field on the 'toolset-test-page' that you created. However, there is no "Properties" post type that I can find.

Here are the exact steps that I am taking once I am logged in to the WordPress Admin:
1. Click 'Pages'
2. Click on 'Toolset Test Page' to edit the page
3. Click on the 'Add Search Field' button
4. Click on the dropdown for 'Select a Field'

I see no "Properties" post type. I have included a screenshot of what I see in the dropdown.

Does it matter what browser I use?

#1962411

Minesh
Supporter

Languages: English (English )

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

The properties post type will be available on right sidebar under "Content Selection" tab. Please check the following screenshot:
- hidden link

I strongly suggest you should check the following Doc and try to follow the steps:
- https://toolset.com/lesson-placement/lesson-placements-1824669-1621213/

#1962973
Insert-Custom-Search-Filter.jpg
Select a Field dropdown - 2021-02-19_11-15-29.jpg

It seems that there is a step missing in your instructions. I checked the 'Toolset Test Page' that we have been working on and 'Properties' is already selected in the 'Content Selection' section.

It seems like the step that I am missing is what to select in the dropdown after I click the 'Add Search Field' button.

I have tried repeatedly to follow this doc (https://toolset.com/lesson-placement/lesson-placements-1824669-1621213/) but I get stuck on this step:

"For example, you can click to Add Search Field and use the Select a Field dropdown. Select by which content type you want users to be able to search by and click Next."

Once I click the 'Add Search Field' button, I get the 'Insert Custom Search Filter' Wizard. What do I select in the dropdown 'Select a Field'?

I am attaching the screen capture of what I see.

#1963573

Minesh
Supporter

Languages: English (English )

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

Ok - on the following test page - i've removed the City/State filter for now so you can add it.
- hidden link

Please open the above page and:
- Click on button "Add Search Field"
- In the filter’s dropdown that appears select the option "Post relationship or repeatable field groups owner" option.
- In the right sidebar, expand the "Field Settings" section and use the dropdown menu to select the relationship you want to add a filter for. Screenshot: hidden link

This flow is already mentioned here:
- https://toolset.com/lesson-placement/lesson-placements-1824669-1621213/#add-filters-based-on-post-relationships

#1981481

Thank you for your help. I got it working.