Skip Navigation

[Resolved] Post reference in repeatable group

This support ticket is created 4 years 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Author
Posts
#1591975

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

#1592593

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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

#1593045
Capture.PNG

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

#1594099

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

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.

#1600931

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.