How To Create Views in Drupal 8

How To Create Views in Drupal 8

Introduction

Drupal is among the top Content Management Systems (CMSs) across the globe, alongside Joomla and WordPress. The process of creating views in Drupal version 8 is similar to the one for Drupal 7. The only difference is that Drupal 8 has incorporated the Views module. It is automatically installed once you install Drupal 8 core.

Views feature allows the user to display pieces of content on their website in any format. The pieces of content include comments, nodes (articles, basic pages, or blog posts), taxonomy terms (tags or labels), and user profiles.

This tutorial will take you through the steps involved in creating views in Drupal 8.

Let’s start.

Step 1:
Finding Views

  1. To get started with views, check the Article content type by navigating to the admin dashboard, then go to the Structures section and click Content Types. Or follow the path –  â€œadmin/structures/types.”
  2. The next thing is to locate the fields connected to the Article content type. To do so, follow the path (admin/structure/types/manage/article/fields) or go to the admin dashboard again, locate Structures, click the Content Types icon. Then go to the Manage Fields and press Articles, before clicking the Fields section.
  3. To add your content, follow the path – “node/add/article” or go to the admin section, click the +Add Content button, then the Article link.
  4. Once you’ve added your content, the view page will be present in the node teaser, and it should look like this:

Step 2:
Creating a View

  1. To start, navigate to the Manage page and press the Structure tab (admin/structure).
  2. To create an entirely new view, select the Views link on this page. You will be taken to Views Configuration page. You can also follow the path: admin/structure/views.

    On this window, you will notice a slight difference in style layout from the previous Drupal version 7 Views configuration page. By default, there is a wide list of views. Based on your needs, you can choose to edit or duplicate and use these views. You can also create a new view by pressing the Add view button.
  3. The illustration below shows how to edit or duplicate a current view. Drupal 8 Duplicate feature is similar to Drupal 7 Clone feature.
  4. Before we start creating a new view, let’s look at some details about Views and Advanced View settings.Navigate to the Basic section if you want to configure the basic settings (path: admin/structure/views/settings). In this case, you can choose what to display and set it at default, or view the SQL queries in the current view.

    You can access the cache settings by clicking the Advanced section. This is one of the new features in Drupal 8.
  5. Let’s create a new view to list the content type in the view. Use the path – “admin/structure/views/add” or go to the admin section, look for the Structure section, then go to the Views section, and click on the Add view button.You will be presented with a page prompting you to fill in the View name field. For this example, we will use the Article list as our view name. Also, enter the details for the s Show and Of type. We have selected Content and Article respectively for these two fields.Then click the Save and edit button.
  6. You will be taken to the Article list page.
    Here, you need to edit and change the setting Show to Content. To do so, press Show: Fields icon under FORMAT. A popup box will appear as shown below:
    On this page, choose Content, then click Apply. Another popup will appear prompting you to clarify the View mode you prefer. From the drop-down menu, select Teaser and then click the Apply button.
  7. This will take you to the Master display page. For the current view, add an extra page for the display then press the +Add section just after the Master icon. Now, choose Page from the drop-down.
    Your page display will be added to your current view automatically.If you look closely at the Page button, you will notice it has a red-colored border. This indicates that there are authentication errors.
    At this point, set a Path for your page display. Set it under the PAGE SETTINGS. Go to the Path: No Path is set section. You will see a popup that will allow you to indicate the path to present your current view.
    On the popup, enter the path article/list, then press the Apply button.
  8. You will be taken to the views page. Press the Save button to apply these changes. Once you have saved your view, go to the article/list. Here, you will see your article list displayed on your view page. You should see the following:

Conclusion

That’s it! You can now go ahead and create entirely new views in Drupal 8. If you run into problems while creating a view in Drupal, don’t hesitate to contact us for further assistance.

Check out the top 3 Drupal hosting services:

Kamatera
$4.00 /mo
Starting price
Visit Kamatera
Rating based on expert review
  • User Friendly
    3.5
  • Support
    3.0
  • Features
    3.9
  • Reliability
    4.0
  • Pricing
    4.3
Hostinger
$2.99 /mo
Starting price
Visit Hostinger
Rating based on expert review
  • User Friendly
    4.7
  • Support
    4.7
  • Features
    4.8
  • Reliability
    4.8
  • Pricing
    4.7
Ultahost
$2.90 /mo
Starting price
Visit Ultahost
Rating based on expert review
  • User Friendly
    4.3
  • Support
    4.8
  • Features
    4.5
  • Reliability
    4.0
  • Pricing
    4.8
  • Click this link and all your queries to best hosting will end.

How to Create a Landing Page for Drupal 8 Using Display Suite

This Tutorial will show how to Install & Use the Display Suite module with Drupa
3 min read
Jeffrey Scott
Jeffrey Scott
Hosting Expert

How to Create a Landing Page for Drupal Using Panels?

In this tutorial, we will build a Panels landing page for Drupal 8 with Views Bl
5 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to Set Up a User Forum in Drupal 8?

How to Build a User Forum in Drupal 8 using core module functionality & Taxonomy
3 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to Create a Landing Page for Drupal 8 Using Theme Regions

This Tutorial will show how to use Drupal 8 Theme Regions with Menus, Blocks, &
3 min read
Jeffrey Scott
Jeffrey Scott
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top