Skip Navigation

[Resolved] User details

This support ticket is created 3 years, 11 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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: Africa/Casablanca (GMT+00:00)

Author
Posts
#1624725

Tell us what you are trying to do?

We would need our users to add regularly (every month) their pictures (front, back) and weight.
This information details should be listed chronologically front-end on their user profile page.

It's something doable with Toolset?
Thanks

#1624749

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Hello and thank you for contacting the Toolset support.

Yes, that's what Toolset is built for, allowing you to create amazing websites using our user interface.

You will need to create a custom post type that will hold this information, let's call it "Monthly updates". Then create a form to let users add the images and weights. Check the following articles on how to create a custom post type and a form for creating posts.
- https://toolset.com/documentation/user-guides/custom-content/create-a-custom-post-type/
- https://toolset.com/learn/how-to-add-front-end-forms-to-your-website/
- https://toolset.com/documentation/user-guides/front-end-forms/

On the profile page, depending on how you build it, you can insert a view that will display the Monthly updates of the current user ordered by date.

If you would use the regular WordPress author archive page, you will need to write some PHP to insert a view inside of it.
- https://toolset.com/documentation/customizing-sites-using-php/creating-custom-user-profiles/

If you would use a regular WordPress page(/profile/ or /account/ or /profile/activity), you will easily insert/create the view from within the page. Check our youtube playlist on how to use the new Toolset Blocks. And check our documentation for the classic/legacy views:
- hidden link
- https://toolset.com/documentation/

#1624773

Thanks a lot for the infos.
Still is not clear how to create the relationship between the user and the "Monthly updates" CPT.
What if the trainer wants to add the pictures and weight manually for the customer(creating the post back-end)?

In this case the newly created post will have the trainer associated as "author" instead of the customer.

#1625507

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Thank you for your feedback. But let's focus on one thing at a time.

The relationship between users and monthly updates is authorship. Each member is the author of his monthly updates. This will let you create simple queries to get the user monthly updates(author=the_desired_user).

Now, if you want to let the trainer update or add monthly updates for a user, from the backend, can be tricky. Because backend access is handled by WordPress roles and permissions system. So it will be hard for example to let trainers update records for specific users(his trainees). It would be simple to let all trainers update all trainees' records. You will just need to let the Trainers role(default WordPress roles, or custom roles) edit Monthly updates. And you will need to activate author support on the "Monthly update" settings in Toolset->Post Types, so we can assign an author for a Monthly update(which will be useful if you want to let the trainer create new Monthly update for his trainees)

But if you want to do it on the front end, you can limit the number of users each trainer can add/update monthly updates for. By displaying to a trainers only the users that are his trainees. For each user, you can display, monthly updates, and a "Monthly update" create form. On each monthly update, you can add an "Edit form" link or the edit form to let the trainer update user monthly updates.

I hope this answers your questions. Let me know your feedback.

#1626647

If I use the back end approach, in the Author dropdown field, I see only admin, editors and authors.
How can I add also other WP users?

Thanks

#1627011

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

Check this article from WordPress https://wordpress.org/support/article/roles-and-capabilities/

I suppose that your custom post type follows the same permissions as the default Posts type. Only admins, editors, and authors are allowed to create posts and can be assigned to the author of the post.

Go to Toolset->Access->Post Types to customize the permissions for your roles.

#1627833

I have added a function to include this special role in the dropdown.
Of course now I will have to re-label the dropdown to "Trainees" instead of "Author", and this should happen only when adding Monthly updates.

It will probably work, but I'm not really sure about this modification.
I have the feeling that it's more a workaround than a proper solution.

Using a normal database design I would have:

- An additional field "user_id" in the CPT "monthly-update"
- A relationship "users/user_id" = "monthly-update/user_id"

But it seems that Toolset cannot create a relationship between users and posts.

I could create a "Trainees" CPT and add a new entry every time a new user is added. Would that be a solution?
Then I could use a relationship between this 2 CPT (Trainees and Monthly updates), so the Trainer can simply add new Monthly updates using the Toolset relationship.
And customers could use a Cred form to create a new entry.

Do you think this could bring some data security/privacy problem?

Any help is really appreciated.
Thanks

#1630871

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+00:00)

My apologies, but I am not sure to understand, so I'll try to ask some questions and comments below:

I have added a function to include this special role in the dropdown.?
Can you explain more what do you mean? What dropdown? Where? Any screenshots?

Of course now I will have to re-label the dropdown to "Trainees" instead of "Author", and this should happen only when adding Monthly updates.
Do you mean the default WordPress dropdown for the author? If yes you should not, this author is saved in the post record on the database in the post_author column.

In fact, Toolset does not allow relationships between users and posts. To work around it, we go through a custom post type that will represent the user. user<== author of ==>CPT1<== Toolset relationship ==>CPT2

I could create a "Trainees" CPT and add a new entry every time a new user is added. Would that be a solution?
Yes, exactly.

Then I could use a relationship between this 2 CPT (Trainees and Monthly updates), so the Trainer can simply add new Monthly updates using the Toolset relationship.
And customers could use a Cred form to create a new entry.

Yes, that's the frontend solution using Toolset Forms and eventually Toolset Access to manage permissions for different roles of users.

Do you think this could bring some data security/privacy problem?
If you implement the frontend solution, and you configured Toolset correctly, I do not see any security issues. If you have a question/scenario in mind, let me know and we can discuss it.

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