We need to display in the sidebar a list of parent/child elements in a tree-like shape, We already created the parent-child post types but we don't know how to show the parent only once with all childs under each parent, for example
This setup will require the classic view editor in order to achieve. If the classic view hasn't been enabled you can enable it by going to Toolset -> Settings and scrolling to Editing Experience. From there I recommend that you select " Show both the legacy and Blocks interface and let me choose which to use for each item I build".
This will allow you to have access to the classic editor as well as the block editor. From there refresh the page and go to Toolset -> Views.
Now what you will need to do first is to create your Child view that will list your child post and on that child view under the Query Filter section you will add the filter for the Post Relationship. Then select the option "The current post in the loop".
From there you just need to populate your view with the items you want to display in the child view.
Hi Shane thanks,
in order to achieve this we created a custom template with the new black editor but we get some errors (I opened another ticket for that), is it possible for you to have a look at that ticket?
Hi Shane,
regarding this topic, we already created from a previous version of Toolset a connection between post types.
I explain you in detail:
We have a post type called SCHEDE which is the description of a particular building.
WIthin that post we need to show in the sidebar all the STUDIOS that built that building and within each STUDIO the <ARCHITECTS that worked for that building.
The result shall be like in the following URL hidden link
except for the concept that the same STUDIO logo and label shall be displayed once as a parent element and the ARCHITECTS for each studio shall be displayed indented under the STUDIO logo (see the enclosed screenshot).
We know that through the post relationships it is possible to achieve this but we don't know how to do that.
We are creating a custom template with block editor and in the sidebar now we need to insert the blocks needed to display that content.
Please let us know how to achieve the above result
Hi Shane,
I tried to follow the tutorial in the posts you indicated but unsuccessfully.
Maybe there is something wrong in the way we created relationship between data.
We just updated the old relationships to the new method by activating the automatic migration by Toolset.
How can we go ahead?
Do you need to have a look at our environment to see if all data and post relationship are correct and try to create a working view?
Hi Shane,
it's the wrong view, in the URL you sent me we see the whole set of SCHEDE but no STUDIOS and ARCHITECTS.
What we need to achieve is a list of STUDIOS (defined in the post type STUDI) with a subset for each STUDIO where only the ARCHITECTS (defined in the post type ARCHITETTI) are only the data that belong for the specific post type SCHEDA.
If you see the screenshots I sent you and the URL of the OLD site you see what I mean.
Maybe some new relationships between ARCHITECS, STUDIOS and SCHEDE shall be built.
The concept as I wrote in my former message is:
SCHEDA
- STUDIO 01
-- ARCHITECT A
-- ARCHITECT B
-- ARCHITECT C
- STUDIO 2 (if the SCHEDA has a relationship with more than one STUDIO)
-- ARCHITECT D
-- ARCHITECT B (an ARCHITECT can belong to more than one STUDIO)
-- ARCHITECT F
- ARCHITECT G (when an ARCHITECT does not belong to any STUDIO)
The data in the sidebar shall only belong to that specific SCHEDA
Hi Shane,
I sent you this post because it has an example of a STUDIO with 2 ARCHITECTS, you can scroll down the page until you reach the box I sent here in my screenshot attached.
You see that there are 2 Architects Filippo Pagliani and Michele Rossi both belonging to the studio Piuarch, so what I expect to see in the sidebar of this post is something like this:
The correct information should be displaying now. The screenshot helped me to identify the correct relationship between the post types.
You should now be seeing the correct Architects. You should now be able to go in and modify the design output of your views as I've setup a very basic example for you.
Here is the child view with the appropriate filters. hidden link
Also here is the view with the Parent. hidden link
Thanks,
Shane