Skip Navigation

[Resolved] Need Post Type Relationship Multiple Selector in CRED Form

This support ticket is created 5 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/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 5 years ago.

Assisted by: Luo Yang.

Author
Posts
#1229153

I have a one to many relationship for post types, members and documents. I created a post form for documents and included a relationship field for members. When I visit the form on the frontend, I can only select one member to assign to a document. However, when I edit the form via the Dashboard backend, I can select multiple members to assign to a document.

I need to be able to select multiple members on the frontend. I am using the following shortcode. Please advise.

[credform]
	[cred_field field='form_messages' class='alert alert-warning']
	<div class="form-group">
		<label>Document Title</label>
		[cred_field field='post_title' class='form-control' output='bootstrap']
	</div>
	<div class="form-group">
		<label>Folders</label>
		[cred_field field='folder' force_type='taxonomy' output='bootstrap' display='checkbox']
[cred_field field="folder_add_new" taxonomy="folder" type="add_new"]
	</div>
	<div class="form-group">
		<label>Document Upload</label>
		[cred_field field='document-upload' force_type='field' class='form-control' output='bootstrap']
	</div>
	<div class="form-group">
		<label>Assigned Members</label>
		[cred_field field='@member-document.parent' class='form-control' output='bootstrap' select_text='--- not set ---']
	</div>
	[cred_field field='form_submit' output='bootstrap' value='Submit' class='btn btn-primary btn-lg']
[/credform]
#1229204

Hello,

The question is not clear.

I assume we are talking about one-to-many relationship between post types "members" and "documents".

If it is, one "documents" post can connect to only one "members" post, so you can not connect multiple members with a "documents" post.

See our document:
https://toolset.com/documentation/post-relationships/

If you need to setup:
- one "members" post can connect to multiple "documents" posts
- one "documents" post can connect to multiple "members" posts

Then it needs many-to-many relationship.

But Toolset post form does not support many-to-many relationship yet, you can setup relationship form to connect existed posts with others, see our document:
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/

#1230747

Hi. Thanks for the response. The tutorial on how to create a relationship form was helpful. However, I need to be able to select multiple entries for one of my CPTs in the relationship CRED form. Please visit the following Toolset inquiry at https://toolset.com/forums/topic/creating-a-multi-select-relationship-dropdown/

This is exactly what I need. I can already select multiple entries on the backend to add to my relational CPT, but we need it to be done on the frontend. Please advise. 🙂 Eric

#1230775

Yes, you are right, there isn't such a built-in feature within Toolset forms:
One relationship form can connect one post with only another one post at the same time.

You can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

Our developers will evaluate it.

#1230789

Thank you, Luo. OK. One more thing that I need to do. If you visit hidden link you will see that I have two many-to-many relationships: Documents to Folders, and Members to Folders.

I assigned our users to their respective member post type. For example, I created a Member titled Eric Reynolds, and I made me, Eric Reynolds, the author of the Member post. Now, when a member logs into the site, I need her or him to be redirected to a view that only displays the documents of the folders that the members belong to. They will not be able to see any documents of folders that they are not in a relationship. Is that possible?

Also, is it possible to add users as authors to Members posts on the frontend?

Thank you!

🙂 Eric

New threads created by Luo Yang and linked to this one are listed below:

https://toolset.com/forums/topic/one-more-thing-that-i-need-to-do/

#1230851

For the question, please check the new thread here:
https://toolset.com/forums/topic/one-more-thing-that-i-need-to-do/

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