I am trying to:
I have a main CPT called girls and another CPT type called reviews. I have created a one to many relationship to show one girl with many reviews (screenshot of settings attached).
An elementor theme builder page displays the girls CPT post data. On that page I have added an elementor module for a toolset view.
That view is supposed to show a one to many relationship table for many reviews related to the girl post being viewed. So if Kristen had 8 reviews, then a table on her page would list those reviews only and no-one elses.
So far I’ve failed to get this to show any results. The view settings are:
Content Section: Post types - Reviews
Query Options: Don’t include is ticked.
Query Filter: Select posts in a Girls With Reviews relationship that are a related to the current post in the loop. (relationship settings screenshot attached).
Are you able to help me get this to work please? Apologies for some nudity on the site. The page linked to below does not contain any nudity.
Many thanks,
Barry.
Link to a page where the issue can be seen (towards the bottom of the page under the reviews title: hidden link
I expected to see: a table, in this case, showing one row with one test review.
Instead, I got: No data found
Hi Waqar,
In addition to my initial thread above, I've now been able to go into a girl post admin page and manually 'connect' an existing review and that has showed up on the published girl post page correctly as a table row, but I really need this to be an automatic process. Although I know now that what I have done essentially works, can you help to make all reviews automatically appear without needing to be manually connected please. When each review is created a girl is selected from the drop down list in the post relationship field and that association alone is what I thought would show the lost without me having to do anything else.
Many thanks,
Barry.
Hi Barry,
Thanks for asking! I'd be happy to help.
When using the Toolset Types plugin, two posts can be connected using any of these methods:
1. Using the new "Post Relationships":
https://toolset.com/documentation/post-relationships/
2. Using a "Post Reference Field":
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/using-post-reference-fields-to-display-information-from-a-related-post/
Note: The Post Reference Field is also a kind of "One-to-Many" relationship, but it was introduced before the full "Post Relationship" feature became available.
On your website, you seem to be using them both for connecting "Girls" and "Reviews", which is not needed and you can choose to keep just one.
If you'll check your view's "Query Filter" section, you'll see the option to filter based on any of these two filters:
Screenshot: hidden link
Based on your personal preference, you can select the "Girl Post Review Girl relationship" option, if you'd like to use the post reference field interface for this connection (2) or you can keep the "Girls With Reviews relationship" option selected if you'd like to keep on using the "Post Relationship" interface (1).
To avoid any future confusion, it would be a good idea to remove the connection which you won't be using.
I hope this helps.
regards,
Waqar
Hi Waqar,
Thank you once again for a perfect solution. It took a little while to understand the relationship thing but I've edited the query and it works beautifully thanks to you...
Many thanks,
Barry.
My issue is resolved now. Thank you!