Crafting a FAQ page on a Drupal website
How to create a FAQ page using the Drupal core, and other capabilities provided by some contributed modules.
Boosting user experience (UX), SEO, engagement, and so much more—the benefits of a Frequently Asked Questions (FAQ) page are remarkably numerous, and so are the ways to build it on a Drupal website:
- You can rely on the out-of-the-box capabilities of the Drupal core alone, which always has obvious advantages—there’s no need to install, update, or maintain any extra modules or deal with potential compatibility issues.
- You can bring contributed Drupal modules into the game, which might expand the range of options and save time thanks to some preconfigured settings.
- If needed, custom coding can help implement the most specific ideas as to the look and feel of your FAQ page.
Let's look at a step-by-step process of creating a FAQ page with the help of the Drupal core, as well as run through some extra options provided by contributed modules.
Step 1. Creating the FAQ content type
Go to Structure > Content types and click “Add content type.”
Name it “FAQ” or “Frequently Asked Questions” and optionally provide a description. It’s now time to build the structure of a FAQ, which should consist of a question and an answer. The title and the body fields, provided for every Drupal content type out of the box, are perfect for those roles. So you need to change the “Title field label” to “Question.”
Click “Save and manage fields” at the bottom of the page. Next, click “Edit” next to the body field.
In the body settings, change the label to “Answer.” Finally, click “Save settings.”
It’s now possible to create Q&A pairs by going to Content > Add content > FAQ and filling out the “Question” and “Answer” fields.
If you’d prefer to remove the date and author information, click “Edit” on the FAQ content type, scroll down to “Display settings” and deselect the “Display author and date information” checkbox. Click “Save content type.”
Step 2: Displaying your FAQ as a page or a block on your website
To combine all your Q&A pairs into a dedicated page or block, you can use Drupal Views. Go to Structure > Views and click “Add view.” Give it a name and then configure the view to show the content of the FAQ type by selecting “FAQ” in the dropdown.
Next, you’ll see the options to create a page or a block. Let it be a page in this example. Check the automatically created page title and the URL path and edit them if needed. Alternatively, you could create a block and add it to the Block Layout when it’s ready.
In the “Page display settings,” configure the view to display an unformatted list of full posts, which will immediately give you a page with fully displayed Q&A pairs and no extra setup.
Some alternatives could be:
- If you choose to show fields, you’ll need to add the Question and the Answer fields manually in the view settings.
- If you choose to show linked titles, only the questions will be displayed, and users will click on them to go to the answers.
Save the view, and you’ll be redirected to the view settings page.
You can see your FAQ page in the preview at the bottom of the settings or check it out on the front end at its URL path. Be sure to click “Save” on the newly created view.
To make the FAQ page appear in your website’s menu, go to Page settings > Menu of your view configuration page, find the “Menu link entry” and select the “Normal menu entry” checkbox. Provide the menu link title as it will be visible to users. Click “Apply.” Save the view and then see the link successfully appear in the main menu of your website.
Contributed modules for creating a FAQ page
The Views Accordion module enables you to display your FAQ view as an accordion (a set of expandable and collapsible sections) by providing a jQueryUI accordion display format. However, jQuery UI was removed from the Drupal 9 core and jQuery is being replaced by modern JS components, so it doesn't seem future-proof to depend on jQuery-based solutions.
The Views Bootstrap module helps you display your FAQ view as an accordion based on the powerful front-end framework Bootstrap. It has a restriction—it only works properly with Bootstrap-based themes.
The FAQ Field module enables you to add a FAQ section as a field to your content type in any preferred place so it provides additional information for the main content.
The Frequently Asked Questions module comes packed with a ready-to-go FAQ content type and enables you to configure Q&A layouts.
Choose your preferred tools and approaches, and good luck with building a great FAQ page in Drupal!