Skip Navigation

[Resolved] Is there any detailed information on the use of relationship fields

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

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Shane 4 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#1560903

I have a logic conumdrum which I would appreciate any suggestions or pointers over.

I have a CPT for camera lenses. The lens posts will have the same fields but some fields will have different field values depending on which camera it gets used on but it's the same actual lens. OK I duplicate the posts so there are say three posts for any specific lens and each contains the common data such as name and the specific data for a specific camera.

This is fine if the user searches by camera - they will get just the posts that are specific to that camera. My problems is if they search for the lens only they will get multiple posts for each lens.

In the latter case I can restrict the fields displayed to the ones specific to the lens only e.g.g it's name but that doesn't restrict the list of posts. I'll still get say three posts all the same.

Would I be right in thinking I should be splitting the common data fields from the camera specific in some way or using relationship fields. I've done a search for documentation but can only find a passing comment which assumes the reader knows the roles and use relationship fields.

#1561891

Shane
Supporter

Languages: English (English )

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

Hi Richard,

Thank you for getting in touch.

Essentially you're asking if using the Relationship fields will resolve this issue correct?

What kinda of relationship have you setup a One to Many where the Lens can only be for 1 Camera but the camera can have Many lens?

Please let me know.
Thanks,
Shane

#1562135

I'm currently planning it but am expecting it to be a M2M as a lens can be used on many different cameras and a camera can use many different lenses.

#1562853

Shane
Supporter

Languages: English (English )

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

Hi Richard,

Then in a case like this given that you're going to use M2M you wouldn't need to create the same lens for different cameras. The one lens can be related to many different cameras.

In this case when you filter for lens you will only get 1 lens.

Lets say you want to filter Lens for Sony and Olympus cameras. Only lens that are compatible with those 2 will show up. No duplicate lens won't show up because you've only created 1 of that type of lens and related it to both Sony and Olympus.

Please let me me know if this helps.
Thanks,
Shane

#1564853

Can we come back to my original question - is there any documentation on relationship fields and intermediate post types ?

#1565679

Shane
Supporter

Languages: English (English )

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

Hi Richard,

Actually yes we do.

Here is a link to the Relationship documentation.
https://toolset.com/documentation/post-relationships/how-to-set-up-post-relationships-using-toolset/

Please let me know if this helps.
Thanks,
Shane