I am building a directory site. I have a post type (reps) which can be associated with many manufacturers (one to many)
I want to list each manufacturer on the each rep listing. and i want to include some information that is unique to the rep.
so for example i imagine the best thing to do would be to create a repeatable group within a field group, which first lets the user select the manufacturer in question, and then add some custom information. however it seems I am unable to select post reference to repeatable groups. why? is there anything i can do to accomplish what i am trying to?
here is an example mock of of what i am trying to build hidden link
in this example the "greenheck" and the greenheck logo should be linked to the manufacturer CPT, but the text underneath should be customizable and different for every 'rep' post. plus, as you can see these 3 fields should be repeatable
Hi Branden,
Thank you for contacting us and I'd be happy to assist.
Your observation is correct and a post reference field cannot be added into a repeating field group.
( this is because at the back-end a repeating field group is also a kind of post-relationship )
For what you're planning to achieve, it would be best to create a "one-to-many" relationship between the post type "Rep" and "Manufacturers", if one rep can be attached to multiple manufacturers, but one manufacturer can only be attached to a single rep.
Here is a detailed guide on post relationships:
https://toolset.com/documentation/post-relationships/
Once the posts are connected through this relationship, you'll be able to show information from one related post into another:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/
Any information that would need to be saved with each "Rep" or "Manufacturer" post globally, can be saved as custom field attached to that respective post type.
https://toolset.com/documentation/user-guides/custom-content/using-custom-fields/
However, if your goal is to also store some data with each connection made between a "Rep" or "Manufacturer" post, then it would be better to switch relationship type to "many-to-many".
In a many-to-many relationship, an intermediary post type is also created, and custom fields can be added to that intermediary post type, rather than the participating post types, globally.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
than you, that is helpful. i do indeed want to display intermediary post information. I have created a many to many relationship and added intermediary post information.
i am now trying to display that information on the front end. I am looking at this https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-information-from-intermediary-post-types
in the example above, when creating the 'view' block it gives the option to display the intermediary posts. however when i go to create the view, the intermediary post type is not visible as a check box.
you can log into my website here: {link removed}
you can see the content template i am trying to create here: {link removed} it is the content template for the singular view of the 'manufacturer' post type
UDPDATE: never mind, i see that i needed the check box to be publically queriable
Thanks for the update and glad that it is sorted now.
Please let me know if you have any follow-up questions.
For a new question or concern, you're welcome to start a new ticket.
My issue is resolved now. Thank you!