Skip Navigation

[Resolved] How to build parent child post relationship

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

Problem:
How to build parent child post relationship

Solution:
Types offers complete Docs that will help you to understand how you can create post type relationship and display it using views.

You can find proposed solution, in this case, with the following repl
https://toolset.com/forums/topic/integrar-comentarios-en-clases/#post-1081366

Relevant Documentation:
=> https://toolset.com/documentation/post-relationships/how-to-set-up-post-relationships-using-toolset/
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/#3-creating-a-view-that-lists-the-children-of-the-parent-post

This support ticket is created 6 years, 4 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 4 replies, has 2 voices.

Last updated by nandomerino 6 years, 4 months ago.

Assisted by: Minesh.

Author
Posts
#1081286

Buenas;

Necesito algo de ayuda para entender como funcionan la conexión entre diferentes CPT, tengo creado por un lado clases y por otro lado comentarios, la idea es que un usuario pueda dejar comentarios de una clase, y que estos comentarios se muestren a través de una view en la clase correspondiente.

Como siempre gracias por anticipado.

#1081366

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - Spanish support is no available at the moment. I will try to help you in English, hope this is OK.

As I understand, you have two post type Classes (Parent) and Comments (child).

See this Doc to create relationship:
=> https://toolset.com/documentation/post-relationships/how-to-set-up-post-relationships-using-toolset/

Now, once you created relationship, please check following Doc that will help you to understand how you can connect the parent and child post:
=> https://toolset.com/documentation/post-relationships/how-to-set-up-post-relationships-using-toolset/#how-to-connect-related-posts

Once you connected the post - you want that user should be able to add a comment on single class post page. To do that - you should use Toolset form:
=> https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/#creating-forms-when-a-parent-post-is-preselected

Now - to display the ALL Comments (child) belongs to a SINGLE Classes(parent) post - you should create a view and filter it by post relationship:
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/#3-creating-a-view-that-lists-the-children-of-the-parent-post

#1082959

Gracias por la respuesta, he entendido todo perfectamente a pesar del idioma.

Voy a aprovechar para preguntar otra duda:
Tengo un CPT "Profesores" que está relacionado con un CPT "Clases" (un profesor puede tener varias clases) ¿existe alguna forma de hacer que en una view que muestra las clases de cada profesor aparezca el nombre del profesor? Adjunto un par de imágenes para que se entienda como quiero que se muestre y como tengo construida la view.

Gracias una vez más.

#1082960

Minesh
Supporter

Languages: English (English )

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

Glad the know that information I passed help you to understand how you can display the related post.

However - may I kindly ask you to mark resolve this ticket and open a new ticket with your each new question. This will help other users searching on the forum and to write correct resolve ticket summary to which originally issue belongs to.

The good news is that Spanish support is also available for now - so as soon as you create a new ticket our Spanish supporter will be happy to help you with your each new ticket you may have.

Thank you for understanding.

#1082961

Genial así lo haré!