We have clinic post types with connected treatment post types. I want to add a section with three "featured services", which will just be three parts, with some information pulled from three specific treatment posts, that will be different treatment posts for each clinic. While we do already have views on the page that showcase some info from the connected treatments, I need a way to manually choose info from a few treatments, so I went ahead and added Three Post Reference Fields to the field group for clinics, with treatments as the options.
I created a new content template to be used on clinic pages, and am trying to show the content from the reference post fields.
I've been following the documentation on Post Reference Fields(https://toolset.com/course-lesson/using-post-reference-field-to-set-up-one-to-many-relationships/#adding-a-post-reference-field), but when I go to select the Post Source, I don't see the "Parent: <post type name> option". Am I doing something wrong?
Hi,
Thank you for contacting us and I'd be happy to assist.
I added 3 post reference fields on my test website and was able to see the option for them in the template for the clinics.
(example screenshot attached)
Can you please make sure that the treatment posts are selected in all 3 post reference fields for the clinic post, which is selected as the 'View with' (preview) post in the template?
(you'll see this field at the top of the template screen, also highlighted in the attached screenshot)
regards,
Waqar
Thanks for reaching out so quickly. I did have the preview selected correctly and all the treatments connected correctly. It looks like the problem I was having is that I had not set the post types that the content template should be used for. It's working for me now!
This is a bit of a different question, but I'm curious, is there a way to make a "default" post reference, similar to how you can add a default value for other field types? Like if some of the clinics haven't chosen specific treatments, it will use certain default treatments? Or would that have to be done individually within the content template (for example choosing default image or title placeholders with conditionals instead of a whole default post reference)?
Thanks for the update and glad that it is working now.
For the default "default" post reference field value, your observation is correct and there is no option to set that.
You can use conditional blocks to show or hide content in the template, based on whether these fields are empty or not.
Awesome, thank you so much for your help!