Skip Navigation

[Resolved] Autocomplete to select from Posts in custom field

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

Problem: I need to link two posts using a custom field. I currently have this implemented so that I can insert Post B's post ID into the custom field on Post A. This is difficult because the ID is not easily known. It would be better if I could select from other posts using an autocomplete, and automatically insert the post ID in the field.

Solution: We are currently working on the next major release of Types and Views, which includes some big improvements in the way you link posts to other posts, and this issue is being addressed with those improvements. You can follow our blog for updates about these improvements.

Relevant Documentation:
https://toolset.com/2017/12/types-and-views-betas-with-many-to-many-relationships/

This support ticket is created 6 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.

Our next available supporter will start replying to tickets in about 2.84 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 6 years, 11 months ago.

Assisted by: Christian Cox.

Author
Posts
#601221

Hello. I have added a custom field to posts in a client site. This field is meant to add a relevant product code to a product suggested in the post itself. The field is storing the product (which is a custom post type) post id. Now, in wp-admin editors need to manually enter the post id. Is there any way to have editors choose a post from a dropdown listing posts? or have an ajax search performed when users type the post title? Any idea/sample?

#601328

Hi, unfortunately there is not currently an autosuggest feature to select a post as the value of a custom field. We are currently working on the next major release of Types and Views, which includes some big improvements in the way you link posts to other posts, and this issue is being addressed with those improvements. You can follow our blog for updates about these improvements:
https://toolset.com/2017/12/types-and-views-betas-with-many-to-many-relationships/

For now, the post ID custom field is one manual approach we have to link posts in wp-admin. Another solution is to create many-to-many relationships between these two post types, where you can use autosuggest to select from post titles. Both these approaches have pros and cons. The custom field approach, as you have discovered, is tedious because it's not easy to select post IDs in the admin interface. On the other hand many-to-many relationships are easier to manage in wp-admin because you can use autosuggest features, but these many-to-many relationships can be less flexible as custom search filters or query filters.