Skip Navigation

[Resolved] Using the Search for a directory

This support ticket is created 3 years, 10 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
- 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 5 replies, has 2 voices.

Last updated by Luo Yang 3 years, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#1918175

Tell us what you are trying to do?
We are looking to build a new directory site with a list of construction instructors. On their profile we want to list all the courses they can teach so users can simple find instructors via course. However it gets a little complicated as instructors can teach the same course under different accreditations. For example:

An instructor could teach an excavator course but through multiple accreditations:
NPORS Excavator
CPCS Excavator
INHOUSE Excavator

Please see attached how we intent to lay this out on their profile.

For the search we would like to have a dropdown with a list of all of the Courses and then location to find these instructors. The problem I am having is that I don't want the search to show 'Excavator' 3 times, I just want it to show once. So then when you search this, it will list all the instructors who can teach 'Excavator'. Now they may have it under 1 accreditation or multiple accreditations.

I would also like it so when an instructors completes his profile upon sign up, that he can select the Accreditation they offer (NPORS, CPCS, INHOUSE ect) and then select the courses under that accreditation (Excavator, Dumper, Roller ect).

I can't seem to figure out how the Accreditation and Courses link so the instructor can select the same course under different accreditations and how the search will work so the courses are not being duplicated on the drop down list.

I hope this all makes sense.

Thanks in advance for the help, I have been trying to figure this out for weeks but I thought your support would really help me on this.

Thanks,
Jack

Is there any documentation that you are following?
No

Is there a similar example that we can see?
No

What is the link to your site?
No

#1918515

Hello,

I don't see any attached screenshots in this thread, is there anything missing?

There are many technical terms in this thread, I don't understand them clearly.
How do you setup the custom post types and post type relationships?

For the problem:
I am having is that I don't want the search to show 'Excavator' 3 times, I just want it to show once
How do you setup the post view and search form?

Please provide detail steps to reproduce the same problem, thanks

#1918613
Instructor-finder.png

Hi there,

I have not set anything up yet as I am just trying to plan out how best to set this up.

I have attached an image of the profile.

I was going to see if you had any recommendations how to do this.

Thanks,
Jack

#1919995

According to the description and screenshot you provided above.

Here are my suggestion:
1) You can create two post types:
- instructors
- courses

2) Setup many-to-many relationship between above two post types

3) Add a custom taxonomy "accreditations" + "location" custom field in post type "instructors"

Edit each "instructors" post, connect it with other "courses" posts and set the terms of taxonomy "accreditations".

4) Create a page, display a post view with search form:
- Query "instructors" posts
- Filter by:
a) related courses posts
b) "location"
- in view's loop, display the "instructors" post information + "accreditations" taxonomy terms

More help:
https://toolset.com/course-lesson/creating-a-custom-search/

#1920289

Hi there,

Thanks for sending this across, however you need the 'accreditation' to somehow link up with the 'course'.

For example we want to list to courses and accreditations on the profile like below:

- NPORS
- Excavator 360
- Dumper
- Roller

- CPCS
- Excavator 360
- Roller

- INHOUSE
- Excavator 360

So we want people when they sign up on the form to say...

'Do you deliver NPORS courses'
if they say yes then they select from the list of courses CPT

then...

'Do you deliver CPCS courses'
if they say yes then again, they select from the list of courses CPT

then...

'Do you deliver INHOUSE courses'
if they don't tick this and say no then it will not show the courses CPT

This is the part I am struggling with, but all keeping all the 'courses' together for the search form.

-------------

This is a very similar example from another big website in the UK:
hidden link

As you can see on the left they have a 'Skills & expertise' section with drop downs. They have the main 'accreditation/category' as the drop down header, then under they have the 'subcategories/CPT' they offer.

The only difference is that for us on the drop downs some of the 'subcategories/CPT' will be the same (example: 'Excavator', 'Dumper').

Also at the top of the page one their search when you start typing they list all of the services they offer, thats what we want except courses.

I hope this helps.

Thanks for all your work.
Jack

#1921357

What I mentioned above is only some suggestion:
https://toolset.com/forums/topic/using-the-search-for-a-directory/#post-1919995

You will need to setup the custom post types/taxonomies/fields according to what you need.

If you want to search the "instructors" posts by taxonomy "accreditations", you will need to register the "accreditations" taxonomy in post type, so you can search the "instructors" posts with taxonomy filter, see our document:
https://toolset.com/documentation/user-guides/views/filtering-views-by-taxonomy/

Same as above, if you want to search "instructors" posts by "location" field, you need to setup the "location" field in same post type "instructors", see our document:
https://toolset.com/documentation/user-guides/views/filtering-views-by-custom-fields/

Hope it is clear.