Skip Navigation

[Resolved] The best way for A Custom Post type Structure

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

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

Problem:
Needed to create a small school site by using the CPT and taxonomies. What is the best way to structure the Custom Post types (Parent and child)?

Solution:
For this setup I would recommend to use CPTs and with one-to-many relationship between them.

- Classes cpt = will be parent
- Students and Teachers cpt = will be childs of classes cpt.

Creating and Displaying one-to-many Post Relationships using Toolset Types and Views plugin:
https://toolset.com/documentation/beyond-the-basics/post-relationship-concepts/implementing-one-to-many-relationships/

This support ticket is created 7 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 4 replies, has 2 voices.

Last updated by motazA 7 years ago.

Assisted by: Noman.

Author
Posts
#582330

Hi

I needed to create a small school site so I created the following:

Teachers (CPT - Custom Post Type)
Students (CPT)
Classes (CPT)
- Class A
- Class B
- Class C

I need when the teacher logs in he can only see his own class students (say Class A).
So my question here is:

What is the best way to structure the above Custom Post types?
Should i put the classes (A, B, C) as a Taxonomies for both Students and also for the Teachers or should I make it a separate Post Type as I made it above?

How can I make every teacher only sees his own class students?
What is the best way to establish the relationship between them?

Any idea will be a great help

Kind Regards
M

#582677

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Motaz,

Thank you for contacting Toolset support. For this setup I would recommend to use CPTs and with one-to-many relationship between them.

- Classes cpt = will be parent
- Students and Teachers cpt = will be childs of classes cpt.

Creating and Displaying one-to-many Post Relationships using Toolset Types and Views plugin:
https://toolset.com/documentation/beyond-the-basics/post-relationship-concepts/implementing-one-to-many-relationships/

Thank you

#584995
Screen Shot 2017-11-01 at 20.59.03.png
Screen Shot 2017-11-01 at 20.44.53.png
Screen Shot 2017-11-01 at 20.44.43.png

Thanks Noman
That helped me a lot

I got another issue regarding the Ajax update.

Searching for an answer online i can see that this is a known problem for a lot of Toolset users and the answers always like: something wrong with your theme or your other plugins !!!.

So my question here is:
- If i use Number (4) as you can see on the screenshot attached nothing happened when selecting from the drop-down menu (Ajax not working)

- If i use Number (3) then i must add a Submit button and if i do add the Button it does not show on the front end and again the Ajax update not working

- If i use number (3) then i add Text search (input which i do not want and do not use) + Submit button (as you can see from the second screenshot) then everything is working fine

My theme developer said the theme does not block any Ajax call and i cleared all cash and disabled the rest of the plugin from my site plus tested the page on 3 different browsers but still did not work.

How to solve this issue?
Any Idea?

Kind Regards
M<

#585079

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hello Motaz,

That’s technically a different issue. Please kindly open a new ticket for this 2nd issue and we would be happy to help. This will help other users with similar problems to find solutions when searching the forum, We do not handle multiple issues in the same ticket as per support policy. https://toolset.com/toolset-support-policy/

kindly mark this current ticket as resolved if all is good now.

Have a great day.
Thank you

#585104

Ok

The forum ‘Types Community Support’ is closed to new topics and replies.