0

I'm new in Drupal and i have crated a view for content type doctors who have many fields and i choose just some fields to be displayed in the view. Now i want to add a new filter like a select list in my page to select the country of doctor.

1

Create a filter using the field (eg field_country), and select 'Dropdown' under settings. If this is a taxonomy term, select 'Expose this filter', then select 'Is one of' as the operator, and save. This will give you the drop down list.

If it is not a taxonomy term, the sequence might vary slightly, but it will be substantially the same.

  • To get a dropdown, you need a multivalues base for the field, like a taxonomy term or a location:country field, either with a predefined list of countries. Remove your current field, create a vocbulary 'Country', and add a few country names. If you make the vocabulary single level and autotagging, then your users will be able to add other countries. – Triskelion Mar 16 '13 at 16:07
  • so it's impossible to expose a none taxonomy field in a drop down list with the available values in the contents types already added (for me doctors) – Youssef Mar 18 '13 at 0:31
  • Right. If you are currently defining the select list in a list field, move the values to a vocabulary, and change the field to a term reference field. – Triskelion Mar 18 '13 at 0:38
  • But for new doctors i have to add the new country first in the country vocabulary. there is no solution to add directly the field country ? – Youssef Mar 18 '13 at 1:26
  • Use an autocomplete widget for input. Set the vocabulary for tagging, and you can add the country as you add the doctor. – Triskelion Mar 18 '13 at 1:33

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.