Hello,
I'm trying to recreate a directory that I've created in Access. What this form does is display a list of websites based on selections in the form. However, the forms run a little bit different in Access vs Toolset. I was wondering if I could get some help organizing my data so that it can be processed by Toolset. I have a demo video on how I want to form to operate once fully online here:
hidden link
I've also attached a picture that displays the tables and relationships they have, at least mostly.
Please let me know what other information you need. Thank you.
Hi there,
Toolset works with Custom Post Types and Custom Fields.
You can consider the Custom Post Types as a separate table and the Custom Fields are the fields that are inside the table.
To create a custom Post:
https://toolset.com/course-lesson/creating-a-custom-post-type/
To create a custom field for a custom post:
https://toolset.com/course-lesson/creating-custom-fields/
Now when it comes to One to Many and Many to Many relationships between the tables, Toolset has a tool for that which you can learn more about here:
https://toolset.com/course-lesson/what-are-post-relationships-and-how-they-work/
After you create all the necessary Custom Posts, Custom Fields, and Relationships. You can add data in the WordPress backend or create proper forms to let the customers add the data:
https://toolset.com/course-chapter/forms-for-front-end-submission-and-editing-of-directory-items/
The best way to get to know Toolset and see how you can use it for your design of tables I suggest that you take this course:
https://toolset.com/course/wordpress-real-estate-sites/
Thanks.
So I went through the course (the pertinent classes a couple of times) and it seems I’m very close. I’m able to create the form and display some data. However, I can’t seem to get the correct search fields in place, and therefore cannot filter the data as needed. It’s possible that it may be an issue with the basis of the search view. I watched the video on adding search fields based on a relationship, but that didn’t quite get it where I needed.
What information can I provide to get the help I need concerning this search view?
Hello,
I assume the original issue of this thread is resolved, according to our support policy, we prefer one ticket one questions, for other new issues, please check the new thread here:
https://toolset.com/forums/topic/cannot-filter-the-data-as-needed/
This absolutely is the same issue still. Are you guys even reading the post? I ask for very specific info, you say “go learn how this works”. I do, but there are parts that I don’t understand related to the original topic, so I ask more questions, and then you say different topics go on different posts.
I have checked the screenshot + video you provided above:
hidden link
It seems needs four post types:
- Make
- Model
- Platform
- Vehicle
https://toolset.com/course-lesson/creating-a-custom-post-type/
Three post type relationships:
- One-to-many relationship between "Make" and "Model"
- One-to-many relationship between "Model" and "Platform"
- One-to-many relationship between "Platform" and "Vehicle"
https://toolset.com/course-lesson/what-are-post-relationships-and-how-they-work/
Then follow our document to setup post view, filter by above post type relationships + taxonomy filter "category"
https://toolset.com/course-lesson/creating-a-custom-search/
I've watched those 3 videos a few times and to be honest, I get the basic concept, just not how to apply it to my scenario.
Also, you're missing one relationship that's not listed in the picture. It's a many to many with Vehicles and Tuners.
I tried to simplify this setup and changed a few things. I removed the vehicle table so there was one less layer. So right now, I have 4 post types:
Makes
Models
Platforms
Tuners
I have 3 relationships:
A one to many between Makes and Models
A one to many between Models and Platforms
A many to many between Platforms and Tuners
--this also has a custom field called Categories. it's a checkboxes field with 6 options, and you can select one or all of them (shown in Platforms-Tuners Relationship 1.PNG and Platforms-Tuners Relationship 2.PNG
I associated some of the tuners and some of the platforms, so I know the relationships are working. I attached 2 images (Platforms-Tuners Template Relationship and Tuners-Platforms Relationship.PNG) show those associations. What my plan is to pull the list of tuners based on the make/model/platform and category selections. I created the form with this in mind (Tuner Search Form.PNG). The search fields are supposed to pull information from that relationship. However, the drop downs don't have any data so the list never gets filtered.
I need to know how to setup either the relationships or the searches to filter my posts based on the information above. Please let me know if there is any other info I can provide you to get my questions answered. Thank you.
Alright, I was able to get it to mostly work. I'm got the make/model/platform search working. I believe I was able to do so by connecting makes to the models, and models to the platforms. The only thing I have left is the categories search.
I added categories as a custom field in my relationship (Image 1). It's a group of check boxes that have several categories of parts:
Brakes
Drivetrain
Exterior
Interior
Power
Suspension
I made some associations in the tuners page (Image 4). I'm able to get it to pull that field into the search form (image 2). However, even though it's showing the first category, it's not displaying any of the categories on the actual search page (Image 3). I'm wondering if I have the categories wrong or if I have the relationships wrong in some way. As you can see in image 4, the platform is related to the tuner and has categories selected, but it's not pulling the category names into the custom search field.
Seems like this is the last piece of the puzzle. Any help you can provide would be great. Thank you.
I have tried the same setting as you described above in a fresh WP installation + the latest version of Toolset plugins, it works fine, see below test site.
Login URL:
hidden link
1) Four post types:
hidden link
Makes
Models
Platforms
Tuners
2) Three post type relationship
A one to many between Makes and Models
A one to many between Models and Platforms
A many to many between Platforms and Tuners (custom field called Categories)
hidden link
3) Create a page + a post view:
hidden link
- Query intermediate post type "Platforms Tuners Intermediary Posts"
- Filter by:
a) those three post type relationships
b) the custom checkbox field "Categories"
- In view's loop, display the related "Tuners" post information
Test it in frontend:
hidden link
It works fine, you can see the search result s here:
hidden link
hidden link
For your reference.
Hello Luo,
Thank you for your time thus far.
I do see that you have been able to create a test site that works as I need it to. I've been able to get it to work mostly on my side, except the Category box. For some reason, it still won't show any options in that last selection box like you have. I've done some comparisons on both sites and I'm failing to see why yours works and mine does not. The only differences that I could see are:
I have a larger sample data size
I have custom fields in my post types (which shouldn't affect the categories field that I want to filter from)
I have the search view set to AJAX refresh when changing any filter (I changed the test site to match and it still works.
So it's either one of two options:
Either there's a field hidden somewhere that's affecting the form operation
Or I have a plugin that's interfering with Toolset
Before I restore from a backup taken before toolset was installed and start over again, can you look over these comparison pictures and tell me if you see anything that could prevent that field from operating correctly?
Thanks again.
Can you reproduce the same problem in above test site? or share a test site with the same problem, I need a live website to test and debug
That would be difficult without knowing the problem. I will take a day or so to restore my site from a backup and re-create it following your template. I'll report here if I'm successful or if I get the error again.
OK, I have marked this thread as "Waiting for feedback" status, please update here if you still need assistance for it. thanks
Ok, so I restored my backup from before the Toolset install. reinstalled toolset, along with Forms, Types, and Blocks. I recreated the pages with minimal information, just enough so I could relate them and have some sample data to work with. I then created my view and added all of the search fields in there. But the categories area still doesn't populate.
I do finally notice a difference though. In the view block, the block you added was Paragraph, and the post source says Related: Tuner. Mine says Current Tuner. I do not have an option for Related: Tuner.
I recreated the view and that fixed the issue. I see Related: tuner and now I see the categories.
Unfortunately, Now I see a bunch of duplicates though. I'm unsure why that's happening now. Is there a way to get rid of the duplicates? Or maybe something's not setup right?
Since you are using below settings:
1) many-to-many relationship between Platforms and Tuners
2) the custom checkboxes field "category" are in the intermediatory post type
Toolset plugins are using WordPress built-in class WP_Query to query posts, in order to filter the results by checkboxes field "category", views needs to query intermediatory post type, but in your case, multiple intermediatory posts can connect with same one "Tuners" post, so it might conducts the result as you mentioned above: see a bunch of duplicates.
You might consider to move the checkboxes field "category" into post type "Tuners", and setup views to query the "Tuners" posts.