Skip Navigation

[Resolved] Relationship

This support ticket is created 4 years, 6 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1638911
tutors - subject intermediary posts.PNG
relationship.PNG
mark the relationship each post.PNG
Dont know how to link in view...PNG

Tell us what you are trying to do?
I dont know how to show in front end the results of the relationship from each post (many to many)

Is there any documentation that you are following?
hidden link (Up to minute 23)

Is there a similar example that we can see?
base on the youtube channel

What is the link to your site?
hidden link

Issue:

Stuck in tutorial dont know how to show relationship post.
1) Done making relationship
2) Done edit each relationship for each post
3) Got the intermediary-post (Not sure how to use)
4) Dont know how to show the link.

Please refer picture for details.
- Its will be greate if you can provide us.. picture step-by-step... as your tutorial in your website is for pros not newbies like me.

Thanks

#1639141
block-navigation.png
add-sf-block.png
add-link.png
query-filter.png

Hello, it sounds like you have created custom post types and some posts in those post types, and you have also created a post relationship so you can connect Tutors and Subjects in a many-to-many relationship. Next, you want to display related posts on the front-end of the site, and you are stuck. I'll be glad to help! Where do you want to display related posts, exactly? What do you want to display from the related post? Since you did not give those details, I will assume you have created a Content Template for displaying single Tutor posts, and you want to display a list of the titles of related Subject posts in the template for each Tutor. If you want help doing something else, please provide more details about what you want to accomplish.

In the example I just described, there is no need to display the intermediary post type like the video shows. The intermediary post is for other purposes. If I am right, you should go back here:
etuisyen.my/wp-admin/post.php?post=19283&action=edit
I assume this page is the single Tutor post Content Template editor. This is where you will use the Block Navigation menu to select the top-level View Block ( see block-navigation.png ). Now look in the right column and find the Content Selection panel. Uncheck all the checkboxes, then check the Subject post type checkbox. Now use the Block Navigation menu again to find and select the Container block inside your View's loop block. Inside the Container, insert a Toolset Single Field Block( see add-sf-block.png ). In the right column choose "standard field" and "Post title with a link" ( see add-link.png ).

If you save the Content Template now and visit one of the Tutor posts on the front-end of the site, you should see a list of all the Subject post titles, not just those related to the current Tutor post. This is because we have not added a Query Filter to filter the list of Subjects. You must now add a Post Relationship Query Filter to the View of Subjects, so that only related Subject posts are displayed.

To add the filter, go back to the Content Template editor screen in wp-admin. Use the Block Navigation menu again to select the top-level View block. In the right column settings for this block, open the Query Filter panel and add a Post Relationship filter. Select items in your many-to-many relationship as related items of the post where this View is shown ( see query-filter.png ). Update the Content Template and check the Tutor post again on the front-end of the site, and the appropriate Subject posts should be displayed in the View results.

Let me know if you get stuck and I will try to give you more guidance.

Please note: I see the orange button up at the top of the page that says "Content Layout Editor." This means the Toolset Layouts plugin is active. I also see the "Dont know how to link in View" screenshot, where the Block Editor is in use. I strongly suggest you deactivate the Toolset Layouts plugin if you want to use the Block Editor. If you need assistance deactivating Layouts, feel free to open a separate ticket and we can discuss this in more detail. Unfortunately the video you found is a couple of years old, and since that time Gutenberg and the Block Editor updates have been released. The workflow is a bit different now, as you can see, and the Toolset Layouts plugin should not be used with the Block Editor.

#1639495

Hi;

Thank You for the feedback.. Basically I have done it correctly previously.

is just that toolset need some time to synchronize with the relationship Query Filter .

For now I will open this case.. until I really understand the flow of the relationship field..

Thanks for the feedback..

#1640687

That's fine, I will stand by for your feedback.

#1641999

Hi Christian Fox;

If you open youtube channel. You can sign in and after that if you watch any video on youtube. You can trace back the video you have watched at youtube history.

How to make like this , I meant under My Account (as a subscriber) , How I can see the previous video that I have watched.

Basically I got some thinking.
1) I need to create 1 page that archive whole video. where only subscriber can access.
2) Then I need to somehow track each video that the subscriber watched through User ID . (I dont know how to do this)
3) And automatically create the post of list of video that the user ID have watched . (I dont know how to do this)
4) Somehow create the relationship between the post watched list with user ID subscriber and above (I dont know how to do this)
5) Create the video list through view by pulling data under relationship in My Account page. ( Normal Method)

Do you have idea how to do this.

Please advise if you had a better idea.

Thank You.

#1646781

2) Then I need to somehow track each video that the subscriber watched through User ID . (I dont know how to do this)
Unfortunately there's nothing built-in to Toolset that will automatically track who has visited each post, so you would have to use custom code to set this up. Something like the hook shared in the answer here: https://wordpress.stackexchange.com/a/69390
When the hook is fired, you could add the User's ID to a repeating custom field in the post, or you could add the post ID to a repeating custom field on the User profile. Then use that custom field as a filter in a View to display a list of posts.
Or, you could use the instructions in this post to create a post relationship between Users and Posts using a proxy post type: https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

If you need more information about either of these methods, feel free to create a separate ticket to discuss in more detail.

#1647239

My issue is resolved now. Thank you!