Hi,
I am developing a site that has 4 post types:
- State
- Town
- District
- User ad
Most user ads have State>Town>Distritc, and I have no problem with this as I have created 3 relationships, and when I create a user ad he choose the District and all relationships are done:
- state > towns
- town > districts
- district > ads
My issue is that some User ads are posted in towns without district, and I don't know how to relate it to town, as I only have "district" on post type field
Then I would filter by those parent relationships
Thanks!
Hello, I think you have several options. One option is to create a District post called "No District" for each Town that has no Districts. Then each User Ad must be posted to "No District" instead of posting directly to the Town.
Another option is to create a fourth post relationship: Town > Ads. That would allow your Users to associate an Ad directly with a Town. To some degree, the best solution depends on what you want to achieve. You mentioned filtering by post relationships, but I'm not sure what else you plan to use these posts for. Perhaps it would be helpful to set this up in a demo site so you can see how filtering would work with each possible solution?
I started a basic setup here with a few states, towns, districts and ads:
https://christiancox-22119-gswt-1.discover-wp.com/ad-search
If you register for a free account in our sandbox site https://discover-wp.com using the email address associated with your account here on https://toolset.com, I can send you an invitation to collaborate. You can see how things are set up in wp-admin, and we can explore pros and cons of any approach.
Cool Christian, I am registered, what should I do now?
Okay great, you should receive an invitation to join the site. Then you can look at the configurations for the Ad Search View here: https://christiancox-22119-gswt-1.discover-wp.com/wp-admin/admin.php?page=views-editor&view_id=3065
Would you like to try adding the 4th post relationship to this demo site? That would be a one-to-many between Towns and Ads. Then you can add some Ads and attach them directly to a Town, to see how that affects search results. Or maybe there is another scenario you would like to try first?
Hmmm not received Christian, could you please send it again?
Resent, but I have a suspicion this isn't working at the moment. I sent an invitation to a colleague and he did not receive it either. I'll have to ask my systems team to investigate. In the meantime, I have another way to collaborate but it will take some time for me to set it up. I'll update you shortly.
Thanks Christian, that worked!!
Please Christian let that sandbox open and this ticket, I still have one issue
Okay I will keep that sandbox open for the moment. FYI the discover-wp.com site invitation issue has been resolved, so feel free to create sandbox sites of your own there.
Hey Christian,
I have created a new relationship Towns>ads (multilevel)
I must have done something wrong or I need to modify view
I have created an ad with town relationship instead of district hidden link and no result
For ads related to district it works hidden link
Yes and that is a major limitation to this approach - only one post relationship ancestry is supported in the front-end search filters of a single View. If you want to support the district-ad relationship and its town and state ancestors, then it's not also possible to support the town-ad relationship and its state ancestors. Unfortunately with front-end search filters there is not a perfect workaround to this limitation. I added a second View that uses the Town-Ad post relationship filters and inserted that View using conditional HTML if at least a State is selected in the filters. So the workaround isn't perfect, unfortunately, but you can see how it would work here.
Hi Christian,
I am not able to reset password. "Password reset is not allowed for this user"
Any idea?
Thanks
It's a temporary login system. I can send you another login link: hidden link