Skip Navigation

[Resolved] (Pre)populate a select field with another custom post type

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

Last updated by Luo Yang 5 years ago.

Assisted by: Luo Yang.

Author
Posts
#1441277

Tell us what you are trying to do?
We are creating a custom post type (Trips) with a select field. I hope this select field can be prepopulated with data from another custom post type (Destination) so that we can select a Destination from the drop down list while adding a trip, and eventually display Destination data on the frontend Trips page (template and maybe in the archive page). Is it possible to achieve this with Relationships? If so, how do we achieve this?

Is there any documentation that you are following?
We have been following this documentation https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/ but did not understand it completely or it may not cover what we are trying to do?

Many thanks for your help,
Terry

#1441705

Dear Terry,

I suggest you try with custom post reference field, see our document:

https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/using-post-reference-fields-to-display-information-from-a-related-post/

Toolset features a special custom field called Post Reference. You can use it to connect two posts. Once connected, when displaying one of these posts, you can display the data for the other related post.

#1443091

Thank you, Luo, for your help!

Our destination data consists of Country, Region and Area. I have read and understood all of these fields can be displayed in a template or archive page.

Can all three fields also be displayed in a frontend form where authors can select Country, Region and Area? And would it be possible to make this conditional, for example Region A is only displayed when Country X is selected?

Would this work with post reference field? Or is this only working for relationships?
Many thanks again,
Terry

#1443585

There isn't such kind of feature within Toolset Forms plugin, you can add a feature request for it, our developers will evaluate it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/