Skip Navigation

[Resolved] Post relationship example for Beta 2.3

This support ticket is created 7 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 7 replies, has 2 voices.

Last updated by daveG-7 7 years, 1 month ago.

Assisted by: Beda.

Author
Posts
#575001

I hope to use a many to many relationship on a site I'm building for a distillery. There will be two custom post types, Products (ie, Apple Brandy, Rye Whiskey) and Cocktails (ie, Mojito, Moscow Mule). A Product will have multiple related cocktails. Most cocktails will be related to only one product, but some will be related to more than one (a cocktail that contains both Apple Brandy and Rye Whiskey, for example).

When I display a Product through a View or Content Template, I'll want to display the related Cocktail Recipes, with their title, link and featured image. When I display a Cocktail recipe through a View or Content Template, I'll want to display the related Product(s), also with their title, link and featured image.

I set up the relationship with imported post types from my development site to a fresh install, and created the relationship with only one small problem - in the relationship name I tried to use an apostrophe (Products' Cocktail) and it displayed as /' (Products/' Cocktail). That's not a big deal, I can call it something without an apostrophe. It seems likely that adding the information I want to their displays will be easy, and this will be perfect for the project.

#575035

Thanks for the Feedback.

Let me reply here to you about some details first, then, a developer will eventually also enter in contact with you here, to discuss further.

in the relationship name I tried to use an apostrophe (Products' Cocktail) and it displayed as /' (Products/' Cocktail)

I think I know what this is and it is known.
I added this ticket to the internal bug tracker where we filed this issue.
It is no deal breaker as you say, but a cosmetic issue.

I will forward your feedback to the adequate Developers who will then eventually enter in contact with you here.

#575685

I am gathering some Site's Snapshots to see how the data is set up, in order to find out what is the best way to display it, according your descriptions.

Can you send me a snapshot?
https://toolset.com/faq/provide-supporters-copy-site/

Thank you!

#576407

I understand.

Thank you for the Site's Snapshot. It helped me also to see a few issues in the GUI and how things are shown.

The goal you describe will be possible to achieve with Toolset as soon we do have an API and the rest of Toolset (especially Views) will be ready for the Many to Many features.

With Views you will be able to create those displays you mention.
You could also do that (in future) with our API, but that is not necessary here.

I will ask the developers if it is planned to add some attributes to our ShortCodes whereas you could call a "child" as well, just as you now can call a related Parent Post.
I assume, this will be implemented, but I am not sure and will update you here in regard.

#576421

It will be possible both with Types and Views ShortCodes to display directly related data.
This means you will be able to call Parent and Child data of a post directly with a ShortCode attribute.

Please let me know if you have more feedback!

#576610

Thank you. There was one other thing I noticed - when you add a new Custom Post type (say, Product), there is no indication that you'll be able to connect it after publishing it, so at first I didn't think it was working. I understand that you probably wouldn't be able to make the connections before publishing the post type, but maybe a message saying that you'll be able to connect it after you publish it, similar to the message you have for adding new Post Field Groups, "Please save first, then you can select where to display this Field Group" would be helpful.

#576774

This makes sense.

I forwarded this to the Developers.

Thanks!

#577689

I don't have any further issues, so I'll close this thread. I'm eagerly awaiting the release of the updates so I can put my plan in action for this website.

Dave