Skip Navigation

[Resolved] Create Template e View from a Multi to Multi Relationship

This support ticket is created 3 years, 8 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by alessandroD-7 3 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#2033773

HI,
I've 3 types of content:
- employee
- company
- contact data

1 Employee work/worked in MANY Companies
1 Company have/has in MANY Employees
1 Employee have MANY Contacts data
1 Contact data has 1 Employee

Employee <> Company
Employee < Contact

I need this pages:
- Companies List
- Company Detail with Employee list (with filter where Employee with the custom field "Active = 1")
- Employee Detail with his Contact Data (with filter where Employee with the custom field "Active = 1")

Can you help me how to create Templates, Views and Pages? Can you give me some examples?

Regards
Alex

#2033905

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

I need this pages:
- Companies List
==>
To display companies list, you simply create a view to display all companies.
https://toolset.com/course-lesson/creating-a-view/

- Company Detail with Employee list (with filter where Employee with the custom field "Active = 1")
==>
To display company details with employee list, you should create a content template to display the single company and then add a view to display related Employee list.
https://toolset.com/course-lesson/displaying-related-posts/#displaying-many-related-items

- Employee Detail with his Contact Data (with filter where Employee with the custom field "Active = 1")
==>
Again, to display Employee detail, you should create a content template to display the single post of Employee details and display its related post.
https://toolset.com/course-lesson/displaying-related-posts/#displaying-one-related-item-parent

To know about how you should create content template, please check the following doc:
https://toolset.com/course-lesson/creating-templates-to-display-custom-posts/

#2046775
view-list.jpg
user-join-studio.png
template-list.jpg
template-data.png
template detail.jpg
studio-scheda.png
create-view-06.jpg
create-view-05.jpg
create-view-04.jpg
create-view-03.jpg
create-view-02.jpg
create-view-01.jpg
compare.jpg

Hi Minesh,

I tried to do as you suggest but I had problems.
Let me explain what I'm going to do.
I've a list of USERS, each USER has 1 or more STUDIO.
I want to list USERS and for each USER i want to list all STUDIOs data (address, city, phone...).
Here the example: hidden link

I've create the USER and STUDIO Custom Post Types: hidden link - hidden link
I've create the JOIN from USERs and STUDIOs: hidden link
I think the JOIN is correct because here you can see that for this USER and STUDIO data match: hidden link - hidden link

I've create a template: hidden link
the template configuration: hidden link
editing template: hidden link
the system created the view: hidden link

When I try to edit the "USERs loop" adding the VIEW of his STUDIOs I've a problem, I can't save the changes and the "sub-view" hasn't any result.
My steps to create the view:
1. hidden link
2. hidden link
3. hidden link
4. hidden link
5. hidden link
6. hidden link (empty result and unable to save the template)

Where is my error?
Can you help me?

If you need I can create an admin user in wordpress.

Regards
Alex