Skip Navigation

[Resolved] Relationships vs Post Reference

This support ticket is created 6 years, 1 month 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Ben 6 years, 1 month ago.

Assisted by: Nigel.

Author
Posts
#1122019

Ben

What are the benefits of using Relationships to link posts over Post References and vice versa?

Is one way suited to doing a certain thing over another? And are there any specific limitations either way?

#1122582

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Ben

The comparison would be between a Post Reference field to connect two single posts, and a one-to-one Relationship to do the same.

Except, the Relationship is bi-directional, whereas the Post Reference field is uni-directional.

If you connect Left and Right posts together in a Relationship, the Left post knows which Right post it is connected to, and vice versa.

If you instead add a Post Reference field to a Left post to connect it to a Right post, the Left post knows which Right post it is connected to, but the Right knows nothing of the connection.

So when displaying the Left post, you would be able to output fields from the connected Right post, but not vice versa.

With a post Relationship, you could do either.

Relationships are stored in custom tables, whereas the post relationship is simply stored as post meta.

(See https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/using-post-reference-fields-to-display-information-from-a-related-post/)

#1122757

Ben

Thank you for the reply and information Nigel.

I think Relationships are the way to go. They seem to do much more and seem to be easier if you were to want to expand features using Toolset in the future.