Skip Navigation

[Gelöst] Show related post information from another post type

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem: I would like to display information about CPT A in the single post of related CPT B.

Solution: 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 in the documentation linked below.

Relevant Documentation:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/

This support ticket is created vor 6 Jahre, 3 Monate. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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 5 Antworten, has 2 Stimmen.

Last updated by markus vor 6 Jahre, 3 Monate.

Assisted by: Christian Cox.

Author
Artikel
#610098
screen-1.jpg

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 ?

#610468

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.

#611046

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.

#611217

Sure, please provide a link to download that theme in the private reply fields here.

#611482
Screen Shot 2018-01-31 at 10.42.51 AM.png

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.

#611659

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.

Das Forum „Types Community Support“ ist für neue Themen und Antworten geschlossen.

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