Skip Navigation

[Resolved] Displaying Intermediary post type data

This support ticket is created 4 years, 4 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.

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
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 4 years, 4 months ago.

Assisted by: Christian Cox.

Author
Posts
#1418457
screencapture-hccnhub-mergedev-studio-wp-admin-admin-php-2019-12-20-08_48_54.png

Tell us what you are trying to do?

We have a directory website. The main CPT is HCCNs, which are health networks. We also have a CPT for EHRs: Electronic Health Records systems.

Each HCCN uses a few EHRs, and the intermediary post type for the relationship has a radio button to determine if they are just a "user" of the system or an "expert".

The issue:
I'm trying to create a view to put on the HCCN single directory page template, to display which EHRs the HCCN uses and whether they are an expert or user of each.

I have followed your documentation (https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-information-from-intermediary-post-types) but I'm not quite there. It shows the post title for the intermediary post, which is nonsense, rather than the name of the EHR, and I also can't get it to display the expert/user value either. Could you please take a look? I'll post a screenshot of the View. Happy to provide a login for the site.

#1420785

Hi, I can see the intermediary post type is chosen as the View's content, so keep in mind the context of the loop result is going to be the intermediary post type. Down in the Loop Template for this View, I can see the post link shortcode is included like so:

[wpv-post-link]

Since the shortcode has no "item" attribute, the link and title of the intermediary post type (i.e. the context of the loop) will be displayed by this shortcode. If you want to display the title/link of some other post, like a post related to the intermediary post (i.e. the context of the loop), then steps 4 A&B in that document show how you can use the "Edit" button in the Loop Wizard to choose a related post. In your case, that will be the EHR. For future reference, you can select a related post like this in the Loop Wizard. If you want to change it now, you can just delete the wpv-post-link shortcode from the loop template and reinsert that shortcode using the Fields and Views button. In the popup, you'll select the post title with link and then click "Post Selection" to choose a related post. The system will generate the proper syntax for the shortcode and insert it automatically.

On the other hand, the custom field is in the context of the intermediary post type, so no "item" attribute is required. As a test, please remove the item attribute and let me know the results. If the custom field value is not displayed as expected, I'll be glad to take a closer look. Please provide login credentials in the private reply fields here and let me know where I can see the View on your site.

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