Home › Toolset Professional Support › [Resolved] help with relationships
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.
Our next available supporter will start replying to tickets in about 6.84 hours from now. 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 15 replies, has 2 voices.
Last updated by Minesh 5 months ago.
Assisted by: Minesh.
Tell us what you are trying to do? Connect current 'activities' to one of my new 'materials' - Middle School Math Kit. Basically, I already had a relationship that connected an 'activity' to a 'material'. Now I want to connect some of the 'activities' that I already have created to an additional 'material'. So, I know I need to make a new relationship to do this, but I am unsure of how to set this up in the relationships.
This is the new 'material' I want to connect to activities that I have already created that are connected to different materials already. hidden link
Hello. Thank you for contacting the Toolset support.
Can you please tell me what relationship you have between those post types and do you want to connect it from where? using Toolset form if yes - where you added the Toolset form?
If you give all those details and send me problem URL and admin access details, once I review your setup I will be able to guide you in the right direction.
*** 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.
I can see that you have created the following two post-relationship:
- hidden link
- Materials Activities = Materials [0 .. 1] << Activities [*]
=> This is one to many post relationship
- Multi Activities to Materials = Activities [0 .. 1] << Materials [*]
=> This is also one to many post relationship
Do you know Toolset offers many to many post relationship:
- https://toolset.com/course-lesson/many-to-many-post-relationships/
I suggest before creating any post relationship you should understand how Toolset post-relationship works. Toolset supports following post relationships:
- One to One
- One to Many
- Many to Many
Can you check if in your case Many to Many post relationship works?
I suggest best option for you to learn Toolset quickly and export its capabilities:
You can use our free test platform http://www.discover-wp.com and use any of our reference site that is build on top using Toolset features.
This will allow you to create a test site or our free test platform: http://www.discover-wp.com
- https://discover-wp.com/site-templates/
In addition to that - if you want to install any of our reference site we offer on http://www.discover-wp.com on your local machine or server, you can use the framework installer plugin:
- https://toolset.com/course-lesson/using-framework-installer-to-install-reference-sites/
Once you create test site using any of the reference site on your local machine or server - you can even add any other required additional plugins or even run a test with another theme that will help you to run few test and explore and take decision with your findings that what is required and whats not.
By following this path you will have hand-on experience about how you can implement the functionality using Toolset or check the existing features like post relationship.
you can also try to follow any of the course we offer:
- https://toolset.com/course/
okay thank you. It seems like the many to many is working to allow me to add activities to that material. Now I am not able to figure out how to only get those 'activities' to display in the search view. This is the page I am working with:
hidden link
Do you want custom search filter for related activities to the single material? If yes:
Can you please check now: hidden link
Please check how the view search field added and the loop fields are configured.
=> hidden link
Hi Minesh, thank you! This is very close now.
Is there a way to have the material name that show in the view - the line under the title - example for first one is Middle School Math Kit under Identify - to be the other material that the activity is connected to?
Ideally, those other material names would also show up in the material dropdown search. I will not need the activity search dropdown, just the material and grade since there will be 100+ activities for people to see.
Well - then you should either set view source to post type materials and add the search field and then display the related fields as required.
I tried switching it to post type material, but it only showed the middle school math kit, not the other materials the activity is connected to.,
Can you please list all fields you want to display with that view and at what position and those fields belongs to what post type.
Also mention what frontend filters you want (material name and grade) any other?
Sure, thank you!
For the frontend search filters:
1. Material - this ideally will show the other material the activity is connected to, not the Middle School Math Kit. For example, Angle Hop should be an option with the activities that are currently set up.
2. Grade Level
For the view display after searching:
1. Activity Name
2. Material Name - the same material shown in the dropdown choice, not the Middle School Math Kit
3. Activity Short description
4. Activity Grade Levels
5. Button to full activity
You will have to understand first that you can add frontend filters for taxonomy or custom fields that are belongs to post type you query.
So if:
- you have post type X and you assigned taxonomy tax-x and custom fields field-1 and field-2.
- You have post type Y and you assigned taxonomy tax-y and custom fields field-3 and field-4.
Now, if you want to build custom search view for post type X and want to add frontend filters:
- then you can add the add frontend filters for tax-x and custom fields field-1 and field-2.
You can not add tax-y and custom fields field-3 and field-4 as those are belongs to post type Y and you set your view's source to query post type X.
In your case - material name custom field belongs to Materials post type and Grade Levels filter belongs to Activities post type so that's not possible.
I hope you got this and once you clear with what frontend filters custom search fields you want to go I will take this next and check whats possible.
Okay I believe I understand. So, in order to have the custom search as I would like it, I could add another custom field?
Yes - but you have to make decision to what post type you want to add that custom field and for what field and how you will populate the content to that field.
Ok I can try to figure that out. Alternatively, could you explain how the 'using manually entered values' for the dropdown search works? Could I add the materials manually that I want to display in the search?
I believe I was able to make this work by adding another field to the activities called materials used. However, before the user sets any of the search parameters, all of the activities are showing. How do I make the results be blank until the search fields are selected? Or, how do I make the results only show what might be possible by the search fields versus all activities?
New threads created by Minesh and linked to this one are listed below:
https://toolset.com/forums/topic/split-help-with-relationships-hide-search-result/