Skip Navigation

[Resolved] Many to Many Custom Post Types Displaying in Views

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 10 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 3 voices.

Last updated by giuseppeM-2 9 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#206163

I have two many to many relationships set up. One many to many relationship ties people to locations and the other one ties events to locations. These are using custom post types using this tutorial: https://toolset.com/documentation/user-guides/many-to-many-post-relationship/

What is happening: I display two views on one page. In other words I display related events and people on a single location page.

When I pull the data for the fields of the parent inside my view, each view pulls the actual many to many custom posts that are created for the many to many relationship. In other words, the view relating people to the location pulls the related people as well as the Custom Posts for the many to many relationship relating the events to the locations. Just the opposite happens as well, the view relating events to the location pulls the related events as well as the Custom Posts for the many to many relationship relating the people to the locations.

#206667

Hi vinceA,

Could you describe the question with more details?
Yes, you are right:
each view pulls the actual many to many custom posts that are created for the many to many relationship (the intermediary post type).

#206746

The example is this:

People relate to locations through the Many to Many relationship FROM
Events relate to locations through the Many to Many relationship HELD

There are 2 FROM relationships:
FROM-100 - Relates Joe to the Location
FROM-101 - Relates Mary to the Location

There are 2 HELD relationships:
HELD-100 - Relates Dinner to Location
HELD-101 - Relates Lunch to Location

On the locations page I pull two views in relating the associated people and events using FROM and HELD just as in the Many to Many example. I am pulling the title with a link. The issue is when I do this I get an output as follows:

People at this Location:
Joe
Mary
HELD-100
HELD-101

Events at this location:
FROM-100
FROM-101
Dinner
Lunch

I want to know how I can only show the related People and Events under each heading and block the display of the Many to Many relationship pages?

#207109

Here is a test site for you:
hidden link
user/pass: xgren/111111

views for People at this Location:
hidden link
views for Events at this location:
hidden link

content template for single location post:
hidden link

Hope it help

#207247

I got it! Thanks for the example. I had the relationship post types hidden. I unhid them and selected them in the view and it works perfectly. Thanks for taking the time.

#273039

Luoi, any chance you can re-activate those links examples or point me somewhere else. I have the same issue as VinceA.

#273311

I'm starting a new thread.
Let's close this one

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.