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: enlace oculto
Please advise what am I doing wrong.
Thanks
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
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
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
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: enlace oculto
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
Sounds great.
You can go ahead and log in. I have done the backup.
Thanks
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
My issue is resolved now. Thank you!