Skip Navigation

[Resolved] Split: Relationship between Clinic and Therapist

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: Asia/Hong_Kong (GMT+08:00)

This topic contains 11 replies, has 2 voices.

Last updated by Luo Yang 1 year, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#2524209

As I ponder about the best course of action. I created this flowchart and I was wondering if that's the best route for this challenge. If so, then I will need some guidance on how to setup if the user chooses manager.

Things I need to create:
1) User form with an additional custom field (individual or manager)
2) Three forms (one for Therapist, one for Clinic and one for the Relationship form) OR do I have to create four forms (one for individual Therapist, one for manager Therapist, one for Clinic and one for the Relationship form)?
3) My account page with a conditional statement that will show/hide forms. If the user chooses individual then show only Therapist form. If the user chooses manager then first show Clinic form then Therapist form (or do I show relationship form, that's where I'm stuck)

If you could tell me the best course of action that will not impede speed and performance of the site, I would appreciate!

Thanks!

#2524215

Hello,

In my opinion, you can try these:
1) Setup two different user role:
- individual(manage his own Therapist post)
- manager(manage his own Clinic and Therapist posts)
https://toolset.com/course-lesson/setting-up-custom-roles-for-members/
https://toolset.com/course-lesson/setting-access-control/

2) Setup two different user forms for different user roles to register in your website

3) In the "My account" page, check current logged-in user role, and display different content templates:

A) Content template for manager user, display:
- A post view, list his own "Clinic" posts,
https://toolset.com/forums/topic/filtering-views-query-by-author-for-a-profile-page/
- A post form for creating new "Clinic" post
- A post view, list his own "Therapist" posts,
- A post form for creating new "Therapist" post
In the single "Clinic" post, display:
- the editing "Clinic" post form link,
https://toolset.com/course-lesson/front-end-forms-for-editing-content/
- display the relationship form to related it with other "Therapist" post
https://toolset.com/course-lesson/front-end-relationship-forms-for-connecting-posts/

B) Content template for individual user, display:
- A post view, list his own "Therapist" posts,
- A post form for creating new "Therapist" post
In the single "Therapist" post, display the editing "Therapist" post form link,

For your reference.

#2524781

Luo, I will try your suggestion next week and get back to you on that. Thank you and happy new year!

#2526087

Happy new year, please update here if you still need assistance for it, thanks

#2526593

Ok Luo,

I created:
- the 2 custom roles (individual and gerente)
- I created 2 User forms for above
- I created a Clinic Type (Clínica) with almost all the same fields as the Therapist Type (Anúncios) using the same previously created custom fields.
- I created a Relationship Form (Clínica-Anúncios)
- I created 2 Post forms for Clinic and Therapist

As I was testing I noticed that on the Therapist Form I was able to see that I could choose a Clinic. So I created a demo Clinic to see if the form would work, but I was expecting the custom fields that are similar for both (phone numbers, location, etc) to be filled or to not be available since it's already in the Clinic form.

What am I doing wrong? Or do I have to create ANOTHER Therapist Post Form with only a title, images, and the relationship choice (Clinic-Therapist)?

#2526639

Are you going to setup different phone numbers and location values for each "Clinic" post and "Therapist" post?
If you are, you will need to add the those phone numbers and location custom fields into both "Clinic" post form and "Therapist" post form

Please confirm it first.

#2527081

Are you going to setup different phone numbers and location values for each "Clinic" post and "Therapist" post?
If my client owns a Clinic, then I want all the information from that Clinic to be shown in the Therapist Post. In this case, the phone number, location will be the same. So no, they will not be different.

BUT

If my client is an individual, she/he has no Clinic to be associated with, they are independent and they need to add their own phone number and location. This client will not even know a Clinic Form exist.

I don't think Toolset has a way to filter that. I'm thinking I will have to create an individual Therapist Form and another Therapist Form just for clients with Clinics. Am I correct?

#2527551

Yes, you are correct.

Two post forms for creating new "Therapist" post:
- One for individual users
- One for manager users

#2527793
NoConditional.png
shortcode.png

Luo,

Now this is where I am a bit stuck. I am using Elementor Pro for the design of the single.php post for Therapist. Toolset's gallery image is just ugly and I will not be using, thus, Elementor it is.

How can I build a template that would show the information for Independent Therapist and for Therapist that are associated with the Clinic?

Currently I'm using shortcode to include the fields because they have additional function, such as click to call on phones and click to chat on whatsapp. (Attached image)

Toolset offers no conditional function (Attached image) in order to differentiate between Independent Therapist and Clinic Therapist information.

So, how do I setup the single.php page that will show the correct information?

#2528267

You can use Toolset Access shortcode [toolset_access] to display different contents on different user roles.

For example, only "Administrator" and "Author" users can see the content:

[toolset_access role="Administrator,Author" operator="allow"]
some other shortcodes here
[/toolset_access]
#2528583

Luo I think we are having a "Lost in Translation" kind of communication.

My previous post was about creating a single.php file to show my visitors (everyone who sees the website) the information about the post.

What you suggestion is good for back end (my clients, the users, to see and edit their information).

So in the front-end (for everyone to see, the visitors of the website), how can I create a template that will show the post information?

Do I have to create 2 templates? One for individual therapist and another for therapist who are associated with a clinic?

Is it even possible to have 2 templates for single.php?

#2529973

No, the shortcode [toolset_access] ... [/toolset_access] works in frontend.

As I mentioned above, you just need one content template, in this content template, display three [toolset_access] shortcodes, each of them display different contents for different user roles:
- individual
- manager
- Guest

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