1

I am new to drupal and I already created a table using view. I also applied exposed content filtering and I got the following screen

enter image description here

Now I want to show all the category and author are listed in a drop down and i want to select one from that. Also how can I display all the content of table before filter?

Thanks in advance.

3
  • Can u please specify Also how can I display all the content of table before filter
    – Abin
    Commented Nov 4, 2015 at 5:21
  • i think when you have created a field "category" and "author" in your content type .you have selected "novel" and "rachit sharma" as a default value
    – user52318
    Commented Nov 4, 2015 at 5:36
  • @vishnu !!!cheers
    – user52318
    Commented Nov 4, 2015 at 6:57

3 Answers 3

0

Any time you need a dynamic dropdown view filter, you need a Taxonomy vocabulary (Drupal core).

In your example, you need first to create a vocabulary named Authors (no need to enter terms).

Secondly, you add a field Author, type Term reference, related to your vocabulary Authors, in the content type displayed in your View.

Choose autocomplete widget to allow term creation when a content is created.

Now, if you create a new content and enter a value in the field Author, it will add each new term or suggest existing ones.

Finally, in your View, you add an exposed filter related to your field Author, and you can select dropdown list. All authors entered during content creation will appear in the list.

If you need to enter manually authors, you just have to get to your Vocabulary Authors and add terms. They will also appear in your dropdown filter.

Hope this helps.

2
  • Is it practical to create hundreds of authors as term? I dont know, I just start drupal, I commonly use the vocabulary for adding general categories like Category of books , Gender, etc for easy choosing Commented Nov 5, 2015 at 5:40
  • Concerning the author field values, it depends on the amount of data. Of course you can enter your content one by one and each time you fill the field Author with a new value, the vocabulary will grow. If you have hundreds of lines in your external database, you should try the Feeds module... but this is another subject, I guess. Anyway, if your website allow contributors to add content, your vocabulary (and consequently your exposed filter) will be created progressively by users.
    – Toki
    Commented Nov 6, 2015 at 9:40
0

You can change filter view settings. goto admin/structure/views and edit your views and follow the screenshots

enter image description here

enter image description here

3
  • Thanks for the quick support :) But I have no such settings link there. Is it get by adding any additional module? Commented Nov 4, 2015 at 5:55
  • 1
    @Vamsi, you are assuming that the fields Category and Author are term reference fields. Since Vishnu cannot find the setting, I believe he is dealing with Text fields. Vishnu, the Dropdown option only appears for Term reference fields. You may want to create Vocabularies for Category and Author, and change the fields "Category" and "Author" to Term references referencing terms in those Vocabularies.
    – argiepiano
    Commented Nov 4, 2015 at 6:01
  • @ argiepiano, You are right! I just trying this with text fields. Is there any way to show the list of entered author as list as term reference Commented Nov 4, 2015 at 6:21
0

You can do it when you select add filter checked dropdown box

enter image description here

For more details dynamically-filter-content-drupal-view

3
  • Thnks for your quick reply :D Commented Nov 4, 2015 at 5:41
  • have you check mention link Commented Nov 4, 2015 at 5:45
  • yup.. but as per the instruction, I dont get any dialog asking selection type. Any extra module needed do so? Commented Nov 4, 2015 at 6:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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