Skip Navigation

[Resolved] I can't select Related Post in a View

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

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 8 replies, has 2 voices.

Last updated by nadavL 3 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#2201585

I have 2 posts types. One called Tours and the other called Places To Stay.
I've added relationships between them and when I try to add Places to Stay to a Tour template, I can't see the relevant fields.

Please see the following video screenshot for more details: hidden link

Please advise what am I doing wrong.

Thanks

#2201869

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nadav,

Thank you for getting in touch.

In this case you will need to have a view that is displaying the intermediary CPT in order to display the relationship fields as you won't be able to access them like this.

Alternatively you can use the shortcode method to display the fields and use the item attribute to get the value of the intermediary field.
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/item-attribute/

Specifically you will need to do it like this.
[types field='field-slug' item='@{relationship-slug}.intermediary '][/types]

This should be able to allow you to get the value of the intermediary post fields.

Thanks,
Shane

#2203507

Hi Shane,

I followed your CPT relationship guide and am not sure why I need intermediary CPT but as long as it will work I'm ok with it.
Please explain what exactly you mean that I have to do.

I really don't want to start working with shortcodes.

Thanks

#2205047

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nadav,

I did some more testing on this one and found that you can do it with the Single field block. From your video you are using the Image block which I believe doesn't seem to allow for the data to be pulled.

In my testing you are able to select the intermediary fields. As a workaround you can use the single field block to display the image.

Please let me know if this helps.
Thanks,
Shane

#2205101

Hi Shane,

I've tried this but even when using a single field I only see the current post type (Tours) fields and not the related post type (Places to stay).
You can see it in the video: hidden link

#2205143

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Nadav,

I will check on the site and its relationships once you can confirm that you've done the backup as according to the other ticket we are handling.

Thanks,
Shane

#2205675

Sounds great.
You can go ahead and log in. I have done the backup.

Thanks

#2206155

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-10-26 at 9.43.20 AM.png

Hi Nadav,

I saw the issue why your relationship wasn't showing up. The content template was previewing a post that did have a places to stay relationship established.

If you switch the preview to The Cube Houses, Rotterdam you will now see your relationship showing up for the dynamic sources.

Please let me know if this helps.
Thanks,
Shane

#2206277

My issue is resolved now. Thank you!