Problem:
In my site there are two different user types I'm building pages for. Athletes and Trainers.
Athletes have a Trainer associated. I've added a usermeta field to the athletes called "trainer_id" which has the ID of the assigned trainer.
I was intending to create a view which displayed the trainer for the current logged in user, but I can't work out how as it seemed like the relationships work the wrong way.
Solution:
You can use Types shortcode to get current logged-in user's field value, for example:
[types usermeta='trainer_id' current_user='true'][/types]
Then pass it to below user view as shortcode attribute:
https://toolset.com/forums/topic/view-to-select-an-associated-user/#post-1640203
Relevant Documentation:
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 2 replies, has 2 voices.
Last updated by 4 years, 6 months ago.
Assisted by: Luo Yang.