Skip Navigation

[Resolved] Help setting up City / State search.

This support ticket is created 7 years, 11 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by jamesH-10 7 years, 11 months ago.

Assisted by: Luo Yang.

Author
Posts
#402770

I am trying to: replicate something very similar to the city / state filter in the real estate example but I am not able to find a lot of documentation on this.

I have created the post types state and region ( city doesn't apply so well to this project ).

My questions:
How do I assign these parent-child relationships for the individual property listings?

In the demo they seem to be assigned manually. If I set them in a create post CRED form, can I arrange them into separate select elements per state?

Next question is how do I set up the state / city pairing in the parametric search? I cannot find anywhere that specifies how to set them up as a pair.

Thanks guys,
Chris

#402992
194.JPG

Dear Chris,

Q1) How do I assign these parent-child relationships for the individual property listings?
You can setup the parent-child relationships as below:
1) setup the post type "State" as parent post type of "City"
2) setup the post type "City" as parent post type of "property"
More help:
Creating Post Type Relationships
https://toolset.com/documentation/user-guides/creating-post-type-relationships/

Q2) If I set them in a create post CRED form, can I arrange them into separate select elements per state?
Since there isn't direct relation between post type "State" and "property", so you do not need to setup the "State" in "property" post

Q3) how do I set up the state / city pairing in the parametric search?
You will need to setup the parent filter like this:
Create a view select "property" posts, in section "Filter", click button "New filter", choose option "Post relationship", see screenshot 194.JPG
More help:
wpv-control-item
https://toolset.com/documentation/views-shortcodes/#wpv-control-item

#403002

Hi Luo,

Thanks for your help as always.

With question two by using state as a filter for the regions I can reign in the number of regions that a user has to select from. To keep with the real estate example if all of the cities in the US were listed in the select it would be very long. Filtering by state would mean that the select would only display the cities in that state.

Thanks mate,
Chris

#403031

There isn't similar feature within CRED form, I suggest you setup a transition page, in the page create a nested view, list the states and related city, in each city post, output the CRED form link for creating the child property post.
See our document:
CRED Forms for Child Content
https://toolset.com/documentation/user-guides/#cred-topics

#403032

Okay thanks mate. I had been considering that option just this morning and seems like a reasonable way to go.

Thanks again for your help. 🙂

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