-1

I have a vocabulary "school" which has these fields.

School Name:

School Type:(male/female)(term reference)

School City:(term reference)

Now, I need to add the school term reference in the registration process. I used profile2 and added the below vocabularies as a select list.

-School Type

-School City

-School Name

I need to filter the school name based on type and city.

show schools in the select list where type= female and city = xyz

Something like hierarchical select but how this all be applied in above case?

0

Your taxonomy architecture is not hierarchical as city and type are in same term as school name is. if you want to use hierarchical select you need to define you vocabulary as follows :

  • Male
    • city_1
      • school_1
      • school_2
    • city_2
      • school_3
  • Female
    • city_1
      • school_4
    • city_2
      • school_5

but if you prefer the current structure you can create a view (entity reference view mode) which takes two argument and filter school taxonomies and then in your form use Dynamic Dependent Fields so you can pass city and type as argument to your view and view will do the rest job for you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.