Skip Navigation

[Cerrado] Having trouble creating a complex many to many sorted list

This support ticket is created hace 8 años, 8 meses. 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 -
- - - - - - -

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

Este tema contiene 5 respuestas, tiene 3 mensajes.

Última actualización por Waqas hace 8 años, 8 meses.

Asistido por: Waqas.


My question is related to the project you helped me with in this thread

In my many to many relationship I am able to query the camps that belong to a particular venue. (what-i-have-now.jpg) I would like to add to that by sorting this list in a specific way.
1) Each camp as an assigned custom taxonomy (camp-type ie: technology, creative, educational, etc.)
2) I would like to group this list by camp type.
3) I would prefer not to have this query in a single view because the groups of camp-types have to be in specific static order and have different CSS classes applied to the elements.
4) So my query would be: Select camps that belong to current venue grouped by camp-type ordered by camp name (camp name is a link).

Let me know if I am being clear enough.



Idiomas: Inglés (English )

Zona horaria: Asia/Karachi (GMT+05:00)

In the context of "Select camps that belong to current venue grouped by camp-type ordered by camp name", I suggest following work around:

- Create a child view to query the camps, there should be a Post Relationship filter applied and set to "Posts where the view is inserted" (see

- Insert the child view in the venue view's loop

This way when your venues view is rendered, it also renders the camps view within it's loop. So you will have camps related to a particular venue listed out on the page.

For more information, I recommend reading following guides also:


The second last guide is useful in an event, when you want to grab some information from a parent post, within the child post. While the last guide link is useful when you don't want to rewrite the same output for multiple views or want to use a common output code for multiple views.


Hello, I am still having trouble writing the correct view.

With your help I was able to select all camps and group by camp-type taxonomy. (list-camps-group-by-category.png)
enlace oculto

With the many to may relationship I have set up, Camps, Sessions, Venues
I was able to create this view that lists camps that belong to a specific venue (list_venu_camps_view.jpg & camps_view.jpg)
enlace oculto
However, I can't figure out how to group this list by camp-type taxonomy as i did in the first link above.



Idiomas: Inglés (English )

Zona horaria: Asia/Kolkata (GMT+05:30)

Unfortunately Waqas is off today. He will be back on Monday. This is Minesh here to help you further, hope this is OK.

I would like to have access of your install in order to have a better understanding of your post structure.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.



Idiomas: Inglés (English )

Zona horaria: Asia/Karachi (GMT+05:00)

Thank you for providing the details. Please allow me some time to work on this. I will update you as soon as I find a solution.



Idiomas: Inglés (English )

Zona horaria: Asia/Karachi (GMT+05:00)

Please see it working at enlace oculto

I created a demonstration for you and have added some visual stuff to make it self-explanatory. I have also used just titles of the posts to keep it simple.

Please see following 4 views created in Dashboard -> Views:

- Toolset: Camp Types
==> This is simple taxonomy view
==> showing all Camp Types
==> and is a parent view for "Toolset: Camps".

- Toolset: Camps
==> This loops through CPT "camps"
==> with a filter "Camp Types set by the parent View"
==> and is a parent view for "Toolset: Sessions".

- Toolset: Sessions
==> This loops through Intermediary CPT "sessions"
==> with a filter "Select posts that are a children of the Post set by parent View"
==> and is a parent view for "Toolset: Venues"
==> but with little extra record keeping. It passes the Camp ID to the "Toolset: Venues" as below:

[wpv-view name="Toolset: Venues" wpvprchildof="[wpv-post-id id='$camp']"]

- Toolset: Venues
==> This also loops through Intermediary CPT "sessions"
==> with a filter "Select posts that are children of the Post with ID set by the shortcode attribute wpvprchildof" (notice wpvprchildof attribute as mentioned in above code also). This attribute is received here and contains the Camp ID.
==> and displays the Venue Title as below:

[wpv-post-title id="$venue"]

The last 2 views are important to understand. Both loop through that Intermediary Object but behave differently. Since "sessions" is a child to both Camps and Venues, we can easily loop on the sessions, but can refer to their parents using that id="$venue" or id="$camp" attribute in the view short codes.

I hope, I have explained in detail and you can understand it easily.

El debate ‘[Cerrado] Having trouble creating a complex many to many sorted list’ está cerrado y no admite más respuestas.