Skip Navigation

[Resolved] Connect Employee and Specialisme posts

This thread is resolved. Here is a description of the problem and solution.

Problem: I have Employee posts and Specialisme posts. I would like to connect each Employee with one or more Specialisme posts. On the Specialisme single post page, I would like to show all the Employees that are related to this Specialisme, and I would like to know which Employee is the Technical Director, which is an Administrator, and which is a Support person.

Solution: Create a M2M relationship between Employee and Specialisme posts. Add a custom field that allows you to select the role each Employee has in the Specialisme. Then connect the posts using this new M2M relationship. Create a View of Employee posts filtered by post relationship, where the Employee is related to the post being displayed. Add a custom field filter to display only Admins, or only Tech Directors, or only Support persons.

Relevant Documentation:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset

This support ticket is created 6 years, 2 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 7 replies, has 2 voices.

Last updated by MarcelB4224 6 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1135014

Tell us what you are trying to do?

Hi, one of reasons i bought Toolset that i thought (hope) that this was possible. It is a great product but overwhelming in options so i am in learning curve 🙂

I have now 2 post types. 1. Is employees and 2. Specialisme. Each employeer has his own or multiply specialisme. What i like to archief is that when place new post in Specialisme about for example "toolset" it will show in the post all employees that are specialist in "toolset" Ideal is to show even more :

Post about "toolset"
and show from the employee list
1. Technical director
2. Support persons
3. Administration

Hope it makes sense and you understand what i want to make. For now i have little the feeling i have to put also all employees with all information in the Post Specialisme but that would make no sense as it is a lot of to do all double.

Is there any documentation that you are following?

Tried to find some documentation in big internet

Is there a similar example that we can see?

No i am trying to set it up

What is the link to your site?

Its local

#1135679

Hi, I think the best way to handle this is to create a many-to-many (m2m) Post Relationship between Employees and Specialismes. When you create the M2M relationship, add a custom "select" field to the relationship. The options for the select field can be "Technical Director", "Support persons", "Administration", etc.

Then create your Employee and Specialisme posts. After you set up the posts, you can add relationships between Employees and Specialismes. Each time you add a relationship, you can choose the "role" - so your Employees can have different roles for each Specialisme.

If your Employees always have the same "role" for all Specialismes, then the custom field on the relationship isn't necessary. You can use a custom field on the Employee post type instead.

Then to show the different Employees on each Specialisme post, you can display a View of Employees, filtered by post relationship, where the Employee is related to the current post. Add a custom field filter to show only Administrators, or only Support persons.

#1135691

Hi Christian,

Thanks for the response. How to i get the "view" filtered by relationship ?

cheers

#1135706
post-relationship.png

To add a post relationship filter, edit a View and find the Query Filter panel. If you cannot see the Query Filter panel, scroll to the top right corner of the screen and click "Screen Options". You can activate the Query Filter panel here. Then click "Add Filter" and select a post relationship filter.

We have more documentation about showing related posts here: https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset

#1135935

My issue is resolved now. Thank you!

#1137666
vakgebieden olenz.png
view look.jpg
template for view.jpg
result.jpg
relattionship m2m.jpg
choosse werknemer (employee).jpg
Vakgebieden view.jpg

Hi Christian,

I am still not "happy" with how it work. I am able to get the employees connected to the post but it is a "manual" task where i think it can be much easier. And think it is not working how you explained me. Tried again the whole day but i just don't get the view working without manually add the employee(s) to each post. So for moment i added the employee "manually" to each post. But as there are 45 employees and hundreds of posts it will be a lot of work to use it in real live environment.

I am doing it now on my "real" project like this ;

- Werknemers, what means where are all employees with there own speciality.
- Vakgebieden, are the posts where i connect the werknemers (with there own speciality)

img; "Vakgebieden view", here you see that i can manually connect the employee to the post of vakgebieden.
img; "Choose werknemer (employee)" here i must find the employee.
img; "result", and it show the employee in the post.
img;"vakgebieden olenz" is the costume field from werknemer (employee) shown in the post vakgebieden.

Again it "works" but i am sure it is not using the "power" of toolset or am i wrong and means i have to add each employee to each post ?? and not choose speciality and all employees are shown from that specially in ones in the post ?

img;"relationship m2m is the m2m relation as suggested.
img;"view look" how i made the view
img;"template for view" how the view is made.

As you can see in image "choose werknemer" there is a option for "specialisme" but i always must choose a name with it and even when i don't choose on of the specialisme it still will show the werknemer (employee) in the post.

But i am sure i do something wrong here or i miss a important point in your explanation and there is a fantastic solution with 1click in the post (specialisme) and will show all specialist of that post.

Hope you can help me out here

cheers
Marcel

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/connect-employee-and-specialisme-posts-part-2/

#1137744

I cannot reopen this ticket, so I have created a new one where we can continue discussion.

#1137745

O wauw ok i saw it in the email and made a new one "Connect Employee and Specialisme posts, part 2" . Can you delete that one ? (i mentioned you name in the new support ticket i made)