Tell us what you are trying to do? We've created an "Accepting Patients" taxonomy for our "Doctors" posts, so that we can mark which doctors are accepting new patients. However, we have some doctors who work at more than 1 location, and would like to have different accepting statuses for each location (Ex: accepting new patients at one location, but not another). Can you tell me how to customize our taxonomy to achieve this?
Is there any documentation that you are following?
Is there a similar example that we can see?
What is the link to your site? hidden link
Hello,
I suggest you try with many-to-many relationship, for example:
1) Setup two post types:
- Doctors
- locations
2) Setup many-to-many relationship between post types "Doctors" and "locations" with an intermediate post type + custom radio field "Accepting Patients"
So you will be able to connect "Doctors" with other "locations" posts, and setup different field "Accepting Patients" value in the intermediate post type.
More help:
https://toolset.com/es/course-lesson/many-to-many-post-relationships/
Thanks for the help, Luo!
I've created the Doctors/Locations relationship as per your instructions, I'm attaching a screenshot for you to review how that is setup.
I'm also attaching a screenshot of the current View we're using for "Accepting Patients". I looked at the instructions in the link you provided to me, but I'm unclear as to how to add the new relationship to the Query Filter in our current View. I've also attached a screenshot of an admin page for one of our Doctor posts, so you can see how that has been setup.
If you could please provide some instruction on how to do this, it would be much appreciated!
Your edit the view you mentioned above:
1) Query intermediate post type
2) Filter by:
- Custom field "Accepting Patients"
- Filter by post type relationship between post types "Doctors" and "locations"
3) In the view's loop, display it's parent "Doctor" post information
I have enabled the private message box, in case you need more assistance for it.
Thanks for the details, I can login your website, will update here if find anything
I have done below modifications in your website:
1) Edit post view "Doctors Accepting Patients - NEW":
hidden link
in section "Query Filter", change the filters as below:
- Select posts in a Accepting Patients relationship that are a related to the current post in the loop.
- Select items with field:
Accepting Patients is a string equal to VIEW_PARAM(ap)
in section "Loop Editor", change the codes as below:
<li><a href="[wpv-post-url item="@accepting-patient.parent"]">[wpv-post-title item="@accepting-patient.parent"]</a> - accepting-patients: [types field='accepting-patients'][/types]</li>
2) Edit the layout
hidden link
Change the view's shortcode from:
[wpv-view name="doctors-accepting-patients-new"]
To:
[wpv-view name="doctors-accepting-patients-new" ap="1"]
So it will output results which "Accepting Patients" fields value is 1
And you can change the shortcode attribute "ap" value to other option's value, for example: 2 ...
See your field settings here:
hidden link
3) Edit a location post,
hidden link
Connect it with another doctor post
Test it in front-end:
hidden link
It works fine. please test again, check if it is what you want
Thanks Luo!
The way you have it setup now, with the options being set in the Location post and not the Doctor post, makes more sense to me.
I've run into 1 issue - at some locations, we have doctors that are accepting for more than 1 service. Ex: in the link below, Dr. Randeva should be accepting for both IUD (value=3) and Botox (value=2).
hidden link
It looks like I can only have him assigned to 1 value, is there a way to set it up so that a doctor can be assigned multiple values?
Thanks again!
You can setup another custom checkboxes field to replace custom "Accepting Patients" field, for example:
Custom checkboxes field "accepting service", with options:
- service 1
- service 2
...
Thanks Luo!
I have the locations and accepting statuses working and setup sitewide, if you don't mind I just need help changing the filter that we're using on our Doctor Finder and then we're ready to push the staging site live.
Below is a link to the View for the form, can you tell me what needs to be changed there so that the search results give only the doctors who are accepting patients (along with their location)?
hidden link
Here is the link to the Find a Doctor page, we use the same search form on the website homepage.
hidden link
Thanks again very much!!
I assume the original question of this thread is resolved, according to our support policy, we prefer one ticket one question, for the new question, please check the new thread here:
https://toolset.com/forums/topic/need-help-changing-the-filter-that-were-using-on-our-doctor-finder/