Skip Navigation

[Resolved] Trying and failing to use Relationships to create Hierarchical dropdowns.

This thread is resolved. Here is a description of the problem and solution.

Problem:

Setup ancestor post type relationship filters with Blocks editor.

Solution:

You can follow our document to setup the filters.

Relevant Documentation:

https://toolset.com/course-lesson/creating-a-custom-search/

0% of people find this useful.

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 Diego Walter Ricciardi 8 months, 3 weeks ago.

Assigned support staff: Luo Yang.

Author
Posts
#2319521

Tell us what you are trying to do?
I'm trying to use Relationships One to Many, to create a hierarchical drop-down and I'm not sure what I'm doing wrong.
To put it simple:
CPTs:
Fabricantes (manufacturers) (one to many)
-Modelos (models) (one to many)
--Version (one to many)
---Año (year) (one to many)
----Motor (one to many)

Then I tried from the last:
Products One to Many to Motor

This would be the idea, I would use those relationships to use in a archive shop loop to search. The one in Real-estate works similarly and I even entered in the test site for that, checked, etc but I can't seem to make it hierarchical. Since actually in the real estate site in the custom search field by relationship, it hads 'ancestors' and with my current setup it doesn't.

Is there any documentation that you are following?

I'm trying to mimic the Real-estate stie.

Is there a similar example that we can see?

The Real-estate site

What is the link to your site?

hidden link

#2320273

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

ancestor.jpg

Hello,

Please elaborate the question with more details:

but I can't seem to make it hierarchical. Since actually in the real estate site in the custom search field by relationship, it hads 'ancestors' and with my current setup it doesn't.

I have tested it in my localhost with a fresh WP installation, it works fine.

When you setup the relationship filter in custom search form, you just need to click the button " Add new ancestor", and add more ancestor filters, see my screenshot ancestor.JPG

#2320675
toolset-Blocks.png

Not sure where you're trying that, but I'm trying it with Toolset Blocks in a Custom Archive.

I don't have the option of adding anything, that is what's puzzling.

#2322391

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

ancestor3.jpg

The screenshot I provided above is using Classic editor to setup the post type relationship filters.

I have tried it to create the Toolset WordPress Archive with Blocks editor, and I can setup the ancestor filters correctly, see my screenshot ancestor3.JPG

So the problem you mentioned above is abnormal, please check these in your website:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) In case it is a compatibility problem, please deactivate all other plugins, and switch to WordPress default theme 2021, and test again

3) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

4) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, also point out the problem page URL and WordPress Archive URL, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#2323069

My issue is resolved now. Thank you!

Yeah I did a fresh install etc, to try out relationships and turns out in the dev site that's currently advanced it works like a charm. I still have no clue why it didn't work in this test site but doesn't matter.
I'll re-open in case it stops working in the other site.
Thank you!