Skip Navigation

[Resolved] Parent Child Relationships

This support ticket is created 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 5 replies, has 2 voices.

Last updated by stewartE 4 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#1715817
service b.PNG
service a.PNG

Hi i'm not sure if this is possible but i wondered if you could point me in the right direction if it is.

I have a content type called Departments which lists each department in my company

I have a content type called Services which lists all the services under each department. I linked them together using a 1-2 many relationship (a department can have many services)

I then created a content type called FAQs and i linked this together with departments using a 1-2 many relationship (a dep can have many faqs)

This is where it gets complicated...

On each Service page I would like to pull through the FAQS of that Services parent page (i.e the department) I've added a couple of screenshots to help explain. Is this possible. Thanks!

#1715965

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Yes - its possible but its not possible using the Blocks as blocks do not support the passing argument as shortcode attribute.

But I've solution for you. If you can share your problem URL for your single service page as well as access details and I would be happy to look at it

*** 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 have set the next reply to private which means only you and I have access to it.

#1716041

Minesh
Supporter

Languages: English (English )

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

There is a little bit confustion.

I'm on the following child service page - and you want to display the related FAQ's connected to the following child service parent page under FAQ section?
=> hidden link

As currently, I can see you added the view [wpv-view name="useful-documents"] within the FAQ section. Where exactly you want to display the FAQs? Can I use the same view "useful-documents" added under FAQ section on above page or should I create a new one and replace it with the existing one.

#1716053

Apologies for the confusion. The useful documents view is not being used in that FAQ box any more. I just forgot to remove it.

So yes I want to display the related FAQ's connected to the Data Management parent page (Data & Analytics) in that FAQ section

I hope that makes sense!

#1716099

Minesh
Supporter

Languages: English (English )

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

Can you please check now: hidden link

I've created the following view and added the "Query Filter":
=> hidden link

Filter by post relationship or repeatable fields group owner
Select posts in a Services FAQs relationship that are related to the Post with ID set by the shortcode attribute wpvrelatedto.
eg. [wpv-view name="view-name" wpvrelatedto="123"]

And within the content template that displays the single child service:
=> hidden link

I've added the view to FAQ section as given under:

 [wpv-view name="display-related-faqs-belongs-parent" wpvrelatedto="[wpv-post-id item='@service-child-service.parent']"]

I can see its working as expected. Can you please confirm.

More info:
=> https://toolset.com/documentation/user-guides/views/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items

#1716155

My issue is resolved now. Thank you!