Skip Navigation

[Résolu] Setting up relationship between two Post Relationship menus when adding new post

This support ticket is created Il y a 6 années et 10 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 3 réponses, has 2 voix.

Last updated by Luo Yang Il y a 6 années et 10 mois.

Assisted by: Luo Yang.

Auteur
Publications
#537343

When I go to add a new post, I have two drop-down menus in my Post Relationship area. The second menu should only list children items of the first menu, but they are functioning completely independent of each other.

My scenario is state and counties drop-down menus. Two states may both have counties that are named the same, and currently my counties drop-down menu shows ALL counties in the system (regardless of relationship), meaning it may list 2+ counties with the same name. It makes it easy to select a county that belongs to a state other than the one the user selected in the first drop-down menu, causing it not to show up in the state listings (because it was assigned to a county that's a child of a different state).

#537514

Dear webD-3,

There isn't such a built-in feature within Types plugin, if you agree we can take it as a feature request, our developers will evaluate it.

#537653

Okay. It would be nice if the feature populated the second drop down after the first one was selected, so it knew what data to display in the second menu.

Another option, which may be simpler (maybe can be done with a function?), would be to join the data with the data used in the first menu, while populating the data in the second drop-down menu. So the first drop-down menu may put "state" in each array item, the second drop-down menu could populate each item in the array with "county" + ", " + "state". If the two tables where combined like that in the second drop-down menu, it would at least make it easier to see which county belongs to which state...even if the drop-down menu still lists every county. Maybe since the relationship already exists in Post Types, it would make it easier?

#538374

It seems you are asking for the similar feature of Views plugin, see our demo site:
hidden link
section "Search Houses", the dropdown menus "Start" and "City", it is setup by Views plugin, which works only in the front-end, and custom search form of Views plugin.
But you need to achieve it in the admin side, area "Post Relationship", which is controlled by Types plugin, as I mentioned above:
There isn't such a built-in feature within Types plugin, if you agree we can take it as a feature request, our developers will evaluate it.

If you need to achieve it with custom codes, according to our support policy,
https://toolset.com/toolset-support-policy/
it is out the range of Toolset support, you can check out our certified partners:
https://toolset.com/consultant/

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