Skip Navigation

[Resolved] How to allow collaboration between users on a custom post?

This support ticket is created 2 years, 5 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
- 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)

This topic contains 4 replies, has 2 voices.

Last updated by himanshuS 2 years, 5 months ago.

Assisted by: Waqar.

Author
Posts
#2204393

I have a custom post type called projects. This post type is in an O2M relationship with another CPT called Expert Review.

Use case: a user can submit a project and then request an expert review. Once the user gets a review, they can improve on the project and request another review.

This scenario works just fine. But I have another scenario where multiple users work on a SINGLE project and then get it reviewed by an expert.

Use case: a few users (say 5) want to collaborate on a project and build something good and get feedback together.

As far as I understand, WordPress allows only one author for a post and there is functionality in toolset access that could allow a user to edit posts by other authors. However, I am not sure how to -
1) Give access to 5 users to collaborate on a project - do I create a dummy project and give them access to edit it? Or Allow one of the 5 to start a project and then add other collaborators later on? Is this possible?
2) Any user can edit the project and the trail of edits should be captured.
3) How to show the name of all collaborators on the front-end of the project.
4) When an expert review is given for the project. How can I send notifications to all 5 users at the same time?
5) Is this possible with Toolset? If not, what are the ways to accomplish this?

#2205611

Waqar
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting us and I'd be happy to assist.

For what you're planning, you'll need to use a workaround of creating a custom post type "User Profile", where every user on the website creates exactly one post in this post type, as the post author.

In Toolset, relationships can only be created between two post types and not between post types and users, so this is the approach we recommend to users who need a search directory of users or need to connect users to multiple post types:
https://toolset.com/course-lesson/how-to-create-custom-searches-and-relationships-for-users/

Once you have set up a "User Profile" post type, it can have a many-to-many relationship with the "Projects" post type, so that multiple users ( through "User Profile" ) can be connected to multiple "Projects".

As for your specific questions:

1) Give access to 5 users to collaborate on a project - do I create a dummy project and give them access to edit it? Or Allow one of the 5 to start a project and then add other collaborators later on? Is this possible?
2) Any user can edit the project and the trail of edits should be captured.

- The proposed approach above, should cover this. In the access settings, all users will be allowed to edit all the "Project" posts, however, the actual edit post form will be shown conditionally only to those users, who have a "User Profile" post, which is connected to that "Project" post being edited.

3) How to show the name of all collaborators on the front-end of the project.

- Since all related users will be linked to a "Project" through the "User Profile" post, you can use a view to show the users working on it.

4) When an expert review is given for the project. How can I send notifications to all 5 users at the same time?

- Using the "cred_notification_recipients" filter, you can add emails from all connected users, as recipients in the form's email notification:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_notification_recipients

regards,
Waqar

#2205643

Waqar,

Thank you for this. How do you suggest I connect the user profile with the project post type?

Should I use a relationship form? Can this be done via email or username? For example, every user in the project group provides their username or email and one person adds them to the group.

I don't want a scenario where any user can see the list of all user profiles on the platform and then has to select one. That is a privacy violation and also becomes unsustainable as the size of the userbase grows.

#2208597

Waqar
Supporter

Languages: English (English )

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

Thank you for waiting.

If you'll use my proposed approach of joining "User Profile" posts with "Project" post types, then, yes, you can use the relationship forms to connect them.

In the relationship forms, you have the option to restrict the selection of posts, to the posts where the current user is the author. This means that the logged-in user will only see 1 "User Profile" post, where he/she is the author, in the relationship form, and not the entire list.

#2209233

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.