Tell us what you are trying to do? To display DISTINCT records. I searched the forum and it seems that there is no solution. I thought I would try asking, just to be sure before moving outside of Toolset.
I have workouts that can contain the same exercise in different tasks.
From the exercise listing, I want to be able to list the workouts that the exercise is used in. If the exercise links 10 times to the workout, it would display the record 10 times. I need to be able to select distinct records. Is it possible without going outside of toolset?
Hi,
Thank you for contacting us and I'd be happy to assist.
Your observation is correct and Toolset doesn't support multiple instances of many-to-many relationships.
( i.e. two same posts can't be joined together multiple times )
Here is a workaround that can be used for a requirement like this:
1. You'll need these 3 custom post types:
a). Exercises
b). Workouts
c). Workout Items
The new post type "Workout Items" will actually hold an individual post for each instance of an exercise that is a part of a workout. For example, if a workaround consists of a total of 20 exercises, there will be 20 posts for this workout in this post type.
2. And to link these custom post types, together, you'll need these post-relationships:
a). Workout Items - Exercises ( One-to-One relationship )
b). Workout Items - Workouts ( One-to-One relationship )
This shows that instead of a direct link, the exercises and the workouts will be linked together, through a common post type 'Workout Items'.
I hope this helps and please let me know if you need any further assistance with this.
regards,
Waqar
I'm not sure, but I think that you are saying to create another relation to keep track of the exercises as one related item? I.e. more work. If correct, that's not something I would do. I would just go outside of toolset and do a query.
Can you confirm that is what you're saying?
Thanks for writing back.
Your understanding is correct and I can understand that this setup will result in more work, in terms of adding/managing relationship records. But, based on what we've discussed, this is the only workaround that I can think of, considering the features, available out of the box.
My issue is resolved now. Thank you!