Home » Drupal » How do I add a search box to a FAQs page?

How do I add a search box to a FAQs page?

To add a search box to your Frequently Asked Questions webpage in the style of the Admissions FAQs, you will need to use the “Quick Access” content type and also create a Drupal View of your FAQs list.

  1. Create a new subpage under your FAQs webpage entitled “List of FAQs” or something similar.

  2. Move your FAQ nodes (i.e. the individual Questions and Answers) to this new subpage.
  3. Delete any remaining content on your original FAQs webpage.
  4. Under “Edit Console” in the top left corner of your screen, click “Add,” and choose the “Quick Access” content type.
  5. Within the editing interface, add your “Title” (i.e. Frequently Asked Questions), “Label” (i.e. Start typing to search the FAQs.), and “Selector.” (The “Selector” for the FAQs Quick Access will always be ‘.question’)
  6. At this time, you can also add “Opening Paragraph” text and an “Image” so that one appears in the top right media space.
  7. Save the changes you’ve made.
  8. Return to the “Edit Console,” click “Add,” and choose “Basic Content.” Within the editing interface, add a “Title” for the content type in brackets [ ] so that it does not appear on the webpage i.e. [FAQs View]
  9. Here’s the tricky part. In order for the FAQ nodes to appear in one uninterrupted list (i.e. the Drupal View), you will need to add the following line of code in the “Body” text: [view:faqs==(tag)] To create the Admissions FAQs webpage, the tag used in the code was “admissions.” Therefore, this line of code was added to the webpage: [view:faqs==admissions]
  10. For your FAQs webpage, you will need to chose a tag relevant to your content to generate the Drupal View. Substitute your tag for “admissions” and add the line above of code to the “Body” text.
  11. Before you’re finished, you will now need to double check all of your FAQ nodes to make sure they have the tag you’ve chosen. If the FAQ nodes are not properly tagged, they will not appear on your new FAQs webpage.
Sites DOT MIISThe Middlebury Institute site network.