Hi, I am trying to solve the following problem: I have two post types, EMPLOYEES and ARTICLES. If somebody writes an ARTICLE I want them to choose a Contact Person to display as a Contact (see screenshot). All Contact Persons are stored in the EMPLOYEES Post Type. Is there a way to manage this in Types, e.g via a Select Field ?
You could accomplish this in several ways. The easiest is probably to use a parent / child relationship to link these two post types. If Employees are the parents of Articles, then an author could select the related Employee in a CRED form or in the wp-admin area when he or she creates an Article. Then in the template that shows Article posts, you can show information about the parent Employee post using the parent field syntax described here:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/
A custom field is also possible, but it is more difficult to manage. First, you have to write custom code if you want to create a custom field that includes options for each Employee post - i.e. a dynamic custom field. Second, if you have a large number of Employees it becomes difficult to select the correct one in a custom field because there is no autosuggest feature like you will find in the Parent post select field. On the other hand, custom fields are easier to use as filters in a parametric search form.
Hi Christian, thanx for your reply. My issue seems to be the same as this one:
https://toolset.com/forums/topic/dropdown-not-showing-up-in-chrome/
in other words: in my backend it`s not showing the dropdown selector of the child post type.
As you figured out in the above thread, it´s a matter of the theme: I am using the Total theme (hidden link) Pls let me know if I should send you a copy privately so you could replicate the error. This would be extremely helpful since I am using this theme on a couple of sites.
Sure, please provide a link to download that theme in the private reply fields here.
Hi, it seems to be working well for me. Here's a screenshot showing a post editor screen. I have the ability to select a parent post (which is called Grandparent, in my case) and I can either create or select child posts as well.
If you cannot see the "Post Relationship" panel in the Article post editor, scroll up to the top of the screen and click "Screen Options". This will expand a section where you can manage the visible panels. Make sure Post Relationship is checked. Then check to make sure you have the post relationship set up correctly. Go to Toolset > Post Types and edit "Articles". Scroll down to the bottom and make sure "Employees" is checked as a Parent post type of Archives.
If you continue to experience problems, I may need to take a closer look.
Hi Christian,
Thanks for your support, it works fine now. Basically this https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/ helped me in the end. I didn`t understand that to display parent pages you don`t neccessarily need a view but to display child posts you need a view.