Skip Navigation

[Resolved] Display taxomines that belong to a particulat post within the form

This support ticket is created 3 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 10 replies, has 2 voices.

Last updated by kaanA 3 years, 6 months ago.

Assisted by: Shane.

Author
Posts
#2135685

Hi there,

I created a Post Form where I collect consultation requests (custom post type). This form is placed in clinic profiles. (custom post type)

Clinics and Consultation Request post types share the same taxonomy named as Surgery.(custom taxonomy)

The form has a select field which shows ALL of the Surgery taxonomy options.
The issue is all clinics do NOT offer all the surgeries.

Would be it possible that form displays the Surgery taxonomy options depending on what clinic is being displayed. (similar to a view but within the form as SELECT field type)

#2135767

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kaan,

Thank you for getting in touch.

Unfortunately, you're not able to make this list dynamic given that you aren't able to specify the terms that should be displayed.

Perhaps you can use some Javascript to Hide the options that you won't be using. Here is an example below of how this can be done in general.
hidden link

Please let me know if this workaround was able to assist you resolving this.
Thanks,
Shane

#2135771

Hi Shane,

"The terms" are the taxonomies that belong to the clinic where the form is being displayed. Would this count?

#2135865

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kaan,

Yes because the terms are what you will want to hide.

The principle is essentially the same as you should be able to use the Javascript to target the specific terms that you want to be hidden on the form.

In the example from the link it shows you how to identify the items in the HTML code to get the correct selector for the term that you want to hide.

Please let me know if this is posing any challenges and I see how best I can assist.

Thanks,
Shane

#2136237

Hi Shane,
Thanks for your support.

My question is whether it is possible to display only the taxonomies that belong to the clinic (where the form is located) rather than displaying all and hiding some afterwards.

Kind Regards,
Kaan

#2139357

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kaan,

My question is whether it is possible to display only the taxonomies that belong to the clinic (where the form is located) rather than displaying all and hiding some afterwards.

If i'm understanding correctly then no it wont be possible.

Looking at how a taxonomy works you will have all the terms that are available on the form. There isn't a way to specify that x terms only belong to Y post type and W terms only belong to Z post Type when using A Taxonomy.

The terms from Taxonomy A will be available on both Y and Z post types.

Thanks,
Shane

#2140525

Hi Shane,

"There isn't a way to specify that x terms only belong to Y post type and W terms only belong to Z post Type when using A Taxonomy."

I do NOT want to display different x terms belong to Y post TYPE.

Maybe it is better if I give an example. I have custom post type called clinic. (clinicA, clinicB, clinicC)
I have custom taxonomy called treatments. (hair transplant, liposuction, nose job)
Then there is a request consultation form. (each submission created a new request consultation entry)

In this form I have field name, phone, treatment type.

This form is located on clinic pages.

My question is if I can list the taxonomies (treatments) offered by the clinic where the form is shown.

#2140545

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kaan,

I see what you are referring to now.

However is the taxonomy on the request form itself ? Or is it that you just want to list the taxonomy on the clinic page only. If such is the case then you can use the shortcode below to list the treatments that belong to only the current clinic being viewed.
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-taxonomy

Thanks,
Shane

#2140565

The taxonomy is in the form as well.

Basically I do not want the operation types that are NOT being offered by the clinic on a consultation form placed on the clinic's profile.

#2140583

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Kaan,

Which is what i've been trying to explain from the beginning, that it won't be possible to filter the terms on the form to only display the ones that the current clinic has. It will pull all the terms from the taxonomy.

Thanks,
Shane

#2140585

I thought you misunderstood the question hence I asked again.

Thanks for your time and help.