Skip Navigation

[Resolved] Display a parent/childs content in a tree-shape

This support ticket is created 2 years, 3 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 33 replies, has 2 voices.

Last updated by Franco Calcagni 2 years, 3 months ago.

Assisted by: Shane.

Author
Posts
#2428021

Hi Shane
The text PIUARCH is the name of the studio as you see in the relationship part of the post where you see the two architect names, so the label PIUARCH is the post title of the studio related post type and besides the label I shall display the featured image but once I can display the post title of the studio then I suppose I can also display the featured image, correct?

Franco.

#2429559

Hi Shane,
did you had the opportunity to review my latest post regarding this ticket? The result still doesn't do what is needed, as I explained in my latest post but please take the screenshot I sent above as a reference on what to display:

- PIUARCH (title of the 1st studio custom post)
----- Filippo Pagliani (title of architect custom post)
----- Michele Rossi (title of architect custom post)

and if in the SCHEDA there are more than one STUDIO involved we need an additional set of data

- PIUARCH (title of the 2nd studio custom post)
----- Filippo Pagliani (title of architect custom post)
----- Michele Rossi (title of architect custom post)

All above data are only referred to the current SCHEDA

You can see an example of multi-studio SCHEDA at the following URL of the website actually online:
hidden link

And this is the same SCHEDA of the site you are working on:
hidden link

Please let me know if it's all clear.
Thanks.

Franco

#2429689

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Franco,

I've got the correct studio name being displayed. However based on your relationship structure its a bit difficult to get the exact outlay of your posts like the link below.
hidden link

You are also able to display the featured images and other attributes of the posts being listed. If you look at the parent and child view you should see a loop wizard button, with this you're able to display any items from the post here.

hidden link

hidden link

From there you should be able to use this to add the items that are needed.
Thanks,
Shane

#2429697

Hi Shane,
if I look at the following post I see the duplicated studio instance
hidden link
what is displayed:
Park Associati
- Michele Rossi
Park Associati
- Filippo Pagliani

what I need to achieve:
Park Associati
- Michele Rossi
- Filippo Pagliani

what I need to have is to show once the same studio and under it the architects related to it regarding that particular scheda.

From your reply I don't understand if I still have to work on the views you created or if since the relationship structure is built in that way there's no possibility to get the result I need. In this case I am willing to change the relationship structure but I need an advice on how to rebuild it so to get the final result I need.

Thanks for your reply on this.

Franco

#2429699

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Franco,

There is not much that can be done about this structure .
Park Associati
- Michele Rossi
Park Associati
- Filippo Pagliani

Its a direct display of how you've setup the relationship.

There are 2 instances of the intermediary post type that connects the different architects.

What is needed here is to connect the Schede -> Studi -> Architects.

So one to many for Schede and Studi
As well as One to Many for Studi and Architects.

Please let me know if this provides some clarity for you.
Thanks,
Shane

#2429707

Hi Shane is it possible for you to build those two relationships?
Then we will pads the data in the posts.
Or if it is possible to transform the actual one to many relationships in many to many without losing data

Please let me know if you can help on this

Thanks

Franco

#2429783

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Franco,

I can assist, however it will require that you re-do the relationships once i've set them up in the relationship tab.

The existing relationships will need to be deleted and redone.

Thanks,
Shane

#2430153

Hi Shane,
OK we can do in this way, you will build the new relationships and the view to see the content as planned in the SCHEDA template.
Then we will update the content in every SCHEDA in the new relationship fields, the only thing that I ask is if it is possible to keep alive the old relationships and their data so I will have all the old reference to rewrite the data in the new relationships, then I will delete the old one. can both relationships cohesist until the work is done?

I rerecap below the rules to be applied for the new relationships:

SCHEDA can have multiple STUDIOS and multiple ARCHITECTS
SCHEDA can have also ARCHITECTS that not belong to STUDIOS so with a direct relationship
STUDIO can have multiple ARCHITECTS and belong to multiple SCHEDAS
ARCHITECT which is the child element of all shall belong to multiple STUDIOS and multiple SCHEDAS

Then in the STUDIO content template (new template to be created) I need to show what SCHEDAS and ARCHITECTS are related to that STUDIO
In the ARCHITETTO content template (new template to be created) I need to show whtt SCHEDAS and STUDIOS are related to that ARCHITETTO

The post types involved in this are:
SCHEDA
STUDIO
ARCHITETTO

Hope this helps

thanks

Franco

#2430667

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Franco,

I've gone and setup this new relationship structure for you. All the items you've listed are now directly related to each other.

You should see the relationship boxes at the bottom of the edit page screen. Also here is an example where i've reconnected the relationships to achieve the desired structure.

hidden link

Thanks,
Shane

#2430949
scheda-studio.png

Hi Shane,
now the page you sent me in the example looks good!
Then I entered the edit screen of the scheda but I do not see your new box relationship that allows me to connect the other scheda posts.
Shall I use that box I attached in the following screenshot or there's a different way to update the other schedas?

If you look at the following page you see "No items found" in the sidebar, how is the workflow to let appear the correct data?
hidden link

With the new relationship structure you set up will we see the result like the following page?
hidden link

Thanks for your info on this so we can proceed with all updates.

Franco

#2431225

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

relationship field.PNG

Hi Franco,

The relationship fields you are look for are actually at the very bottom of the edit page. See Screenshot

These fields should be populated.

Also in there is a similar relationship box in the other post types. Once you've connected the posts correctly using my post as an example then you should no longer see No Items Found on the frontend.
hidden link

Thanks,
Shane

#2431285

Thanks Shane,
I will try to do some test and let you know.
If you don’t mind I leave this ticket open and will close it as soon as my tests are OK.
In the meantime thanks for your support.

Best,

Franco

#2431735

Hi Shane,
unfortunately I do not understand the process you did for relating SCHEDAs, STUDIOs and ARCHITETTOs.
In the example you showed me, I see at the very bottom of the page only the relationship between SCHEDA and STUDIO, and I saw in the STUDIO post type that are filled in the 2 Architects showed in the SCHEDA.
So I assumed that the built relationship goes though the related STUDIO and shows ALL the Architects created to the studio.
I need instead that the ARCHITECT shown in the SCHEDA shall be ONLY some of the ARCHITECTS of the STUDIO (only those that were working for that project and not all Architects of that Studio).
I tried to add an ARCHITECT to the STUDIO Park Associati that is not related to that SCHEDA and in effect I see him in the SCHEDA even if he does not belong to that project.
So please let me know hot to show ONLY the Architects related to the specific SCHEDA and NOT all Architects of that Studio.
That's the reason why we created a direct relationship between SCHEDA - STUDIO and ARCHITECTS.

In addition, how can we show a specific Architect that does not belong to a Studio (direct connection between SCHEDA and ARCHITECT)?

Kindly let me know,
thanks.

Franco

#2433861

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Franco,

Your relationship itself is quite complex and mainly because of the structure you want to achieve.

For instance in the example I made i'm getting the architects through the related studio.

The process is that I've related the Studio and Architects and SCHEDA directly to each other. So my view is selecting the Child post of the Scheda and then displaying the architects attached to that Scheda.

However there is another way to do it. Is it mandatory that you want the Studio where the architects are from displayed ?

Because we can simply list out the architects that are connected to the Scheda directly and then list the studio they belong to.

Which is what was done originally. The requirements makes your ideal setup not achievable with just view and custom code will be required which would be out of the scope of our forum support.

Thanks,
Shane

#2433863

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Franco,

So please let me know hot to show ONLY the Architects related to the specific SCHEDA and NOT all Architects of that Studio.

If you want to show only the architects that are related to the this scheda you only need to go to the Parent view and Select architects as the post type that the view should display.

This will then display only the architects related to this scheda, however in the relationship that i've setup you will need to go and connect the correct architects for this scheda.

Thanks,
Shane