Chat with us, powered by LiveChat

This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

How to Use ‘Views’ Module in Drupal 7

March 19, 2018

4 Min Read
Reading Time: 4 minutes

Drupal 7 is an incredibly flexible Content Management System (CMS) with a vast library of modules that extend its functionality. One such module is the ‘Views’ module.

drupal 7 views module

Views had the highest number of downloads in Drupal 7, and it prompted Drupal developers to add it to the core functionality of Drupal 8.

Let’s look at what makes ‘Views’ so great and how to use it in Drupal 7.

One of the most crucial factors of a website’s success is how it is displayed to the user. Drupal 7 includes some useful content types by default such as articles and basic pages – each with their own default types of display layout. But, what if you wish to add more types of display layouts such as ‘lists’? This is where the Drupal 7 views module comes into play. It has a number of configurations and can be integrated with more than 300 Drupal 7 modules.

The possibilities of views module are practically endless.

Here are some possible scenarios where ‘Views’ module will be helpful:

  • You like the default front page view, but you find you want to sort it differently.
  • You like the default taxonomy/term view, but you find you want to sort it differently; for example, alphabetically.
  • You use ‘/tracker,’ but you want to restrict it to posts of a certain type.
  • You like the idea of the ‘article’ module, but it doesn’t display articles the way you like.
  • You want a way to display a block with the five most recent posts of some particular type.
  • You want to provide ‘unread forum posts’.
  • You want a monthly archive similar to the typical ‘Movable Type/Wordpress’ archives that display a link to the ‘in the form of “Month,’ YYYY (X)”,’ where X is the number of posts that month, and displays them in a block. The links lead to a simple list of posts for that month.

Don’t just think of the ‘Drupal 7 views’ module as just a display option or a layout builder. Yes, it does allow for custom display types, but it’s a lot more than that. It can even filter content from a database, which allows the user to format and display in his required format.

To demonstrate the power of ‘Views,’ I’ll be making a simple blog index.

Install and Enable Drupal 7 Views Module

First, you need to download, install and enable the ‘Views’ module if you haven’t done so already.

‘Views’ Content Type

Next, navigate to structure. Here you should see the ‘Views’ content type. Click on it to access the main ‘Views’ configuration page.

Add a New View

Once here, click the ‘add new view’ link at the top.

Name your view, then select the content type of ‘Article.

Next, in the ‘Create a page’ section, change the formatting if you wish and check the box beside ‘Create a menu link’ to link the ‘View’ in the main menu.

Once done, click ‘save and exit’ button at the bottom.

Check the New View

Now, navigate to the main menu and click the link for the view you created. You should be able to see the page in accordance with the parameters you set for the view.

Conclusion

As you could have guessed just from the simple example shown in this post, ‘Drupal 7 Views’ is an incredibly powerful module and its popularity is a testament to that fact. ‘Views’ can seem to be confusing at the start, but the best way to get familiar with it would be to play around and find what its different settings can do for you. I hope this post proved useful to you.

Let me know in the comments below if you have any questions.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Create interactive Drupal websites easily on the Cloud.

Host your website on optimized Drupal hosting servers.

Hamza Zia

Hamza is a Drupal Community Manager at Cloudways - A Managed Drupal Hosting Platform. He loves to write about Drupal and related topics. During his free time, he can be seen obsessing over Football, Cars, Android and Gaming.

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

BFCM 2019