Skip Navigation

[Resolved] Insert relationship inside a Cred form

This support ticket is created 5 years, 3 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
- - 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 4 replies, has 2 voices.

Last updated by Pat 5 years, 3 months ago.

Assisted by: Beda.

Author
Posts
#1369937

Pat

Hello,

I'm working on a site with 2 postypes ("membres" and "sports").
I want to link membres to several sports.
So I created a relationship (many to many) between membres and sports.
Now, I want to create a post form to create (or modify) a membre and inside, I need to insert the possibility for a membre to choose one or several sports.

Next point is that if possible, I would like the choice of the sport to be like checkboxes and not select (as I have more than 50 different sports listed and would like to be able to arrange the field with some CSS.

Can you help moving forward on this please.
Regards
Pat

#1370529

This is not possible within a Post Form, you will need to create a Relationship Form to connect posts in a many to many relationship
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

It is also not possible to have the selectors as checkboxes, but only as Select Field
This is because you can connect only ONE post to ANOTHER post a time, even if you can repeat that and hence connect many posts to many posts, you can not connect many posts to many posts in "one hit" on one form, but will need to submit that form repeatedly.

I suggest to submit a (or several) feature request for what you outline here https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/, which will be evaluated directly by the Product Manager and eventually can be considered for implementation.

I did in past elaborate on a possible custom solution but this is not what we suggest, given the feature should be instead implemented in Toolset directly (according to how many people request it):
https://toolset.com/forums/topic/bulk-editing-relationships-in-the-new-toolset-3-format/#post-907746
We cannot assist this kind of customizations in the forum, unfortunately.

Please let me know if further clarification or other information is required for you to proceed.

#1370645

Pat

Hi Beda,
Thanks for the clarification.
So, I suppose I need to move forward to another solution.

I can see 2 ways :
1. Use taxonomy in order to define the sport related to a membre
2. Use a checkboxes custom field

I'm more in favor of the taxonomy that will allow a better flexibility for filtering options (this is my opinion?).

Any advice on this, especially on how to present the taxonomy choice in the Cred form as checkboxes?
Regards
Pat

#1371995

You can easily add a Set of (existing) Taxonomies as checkboxes to a Toolset Form, actually you can choose from select, multi select and checkboxes.
See also this DOC in regard:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field

About Filtering, and usage of the Taxonomy versus Field, I agree that this should be a taxonomy just and mainly because it is a "categorizing" subject (not additional information but "groups").
Hence taxonomies are really by definition the best to use to categorize sports.

I suggest thou, set up both very quickly on a staging/testing site, so you can learn about each advantage and disadvantage in light of the needs of your project.
Also, you can use the discover-wp.com site (or Download those sites with Framework Installer), to see how we did similar projects (it does not use sports, but the main idea is similar):
https://discover-wp.com/site-templates/
I'd have a look at this site particularly: https://discover-wp.com/site-types/bootstrap-estate-layouts/

Please let me know if you need further details or examples.

#1374457

Pat

Hi Beda,

I have moved forward with taxonomies (with 2 additional custom field), but it's possible to retrieve them quite easily inside Views.
Thanks for your return.
Regards
Pat