Skip Navigation

[Resolved] child – grandparent

This support ticket is created 5 years, 7 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 9 replies, has 3 voices.

Last updated by abrahamL 5 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1261743
Region_Diagram.png

I am trying to: Display a list of articles (child) in the region's (grandparent) page

Link to a page where the issue can be seen:
hidden link
view name : "Articles - Same Region 3 columns - 03"

I expected to see:
List of articles with featured image, city and inspiration informations:

---
Featured Image
city(ies)
ARTICLES
inspiration(s)
---

Instead, I got: No items found

Thank you in advance.

_abe

#1261877

Dear _abe,

I have tried the credentials you provided, but get this error:
Error 1020 Ray ID: 4e30e51d8a6f53d6 • 2019-06-07 07:25:56 UTC
Access denied

Please check it.

I assume we are talking about this case:
There are three custom post types:
- region
- city
- article
Two post type relationships:
- one-to-many relationship between "region" and "city"
- one-to-many relationship between "city" and "article"

In a single "region" post, you are going to display related "city" and "article" posts information.

If it is, it is possible within a nested view, for example, you can try these:
1) Parent post view: related-city-list
- query city posts
- filter by post type relationship between "region" and "city"
- in view's loop, display city post information + below child post view "related-article-list"

2) Child post view,: related-article-list
- query article posts
- filter by post type relationship between "city" and "article"
- in view's loop, display article post information

3) in the content of single "region" post, display the parent post view shortcode, like this:
[wpv-view name="related-city-list"]

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-view

#1262843

Hi Luo,

Thank you for fast reply.
I tried your suggestion, unfortunately it didn’t work as I expected it to.

It shows cities as a parent, and lists articles under each city.

What I need is to show Articles as main + city + inspiration.

Btw, I fixed the URL login issue.

I’m using Oxygen Builder. To access the “region” single page:
Oxygen >> Template >> Region - single page

Note: “City” and “Article” relationship is many to many relationship.

Thank you.

#1263323
Things-To-Do_Region.png

Just to clarify, that section should be something like this.

Thank you.

#1263627

Thanks for the details, in your case, since there isn't direct relationship between post types "region" and "article", so for the nested views I mentioned above, it is expected result:

It shows cities as a parent, and lists articles under each city.

In you case, you might consider this:
1) setup many-to-many relationship between post types "region" and "article",
2) edit each "article" post, connect it with other "region" posts
3) then in a single "region" post, you will be able to setup a post view:
- query "article" posts
- filter by relationship of post types "region" and "article"
And display "article" posts information.

See our document:
Displaying many related items
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items

#1263641

Hi Luo,

If I set up "region" and "article" with many to many relationships, do I need to enter it the region connection individually, or it can be automated. So if I select the city, it will automatically enter/set the "region"?

#1263657

Yes, you need to enter it the region connection individually and manually, if you select the city, it will not automatically enter/set the "region".

#1263755

Unfortunately, that solution doesn't work for me.
I'm still doesn't understand why this can't work, seems like a common query to me. Anyway, thanks for trying.

#1264061

Minesh
Supporter

Languages: English (English )

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

Luo is on vacation. This is Minesh here. Please feel free to close the ticket.

#1267535

My issue is resolved now. Thank you!