Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Views module in drupal

What are the uses of views module in Drupal?

like image 458
lital maatuk Avatar asked Dec 29 '22 01:12

lital maatuk


2 Answers

At its most basic level, Views is a query builder. It does much more than this though as it allows you to manage the output of your query results and set them up as pages, blocks, feeds, or any other number of output options that can be extended with other modules.

Views is one of the most heavily used modules in the Drupal community. It is currently reported as installed on 270,290 active sites.

Some examples of uses of Views from its project page:

  • 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 5 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 displays 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.
like image 181
markdorison Avatar answered Dec 31 '22 13:12

markdorison


I usually describe is as a "visual query builder", like user247245. On a simpler level, Views can be useful any time you need a list of data "objects" (or their sub-components) from your site (whether content, users, comments, etc.).

A view can be as simple as a single item; for instance, if you want to have a featured story randomly inserted into a block on the sidebar of every page. Views lets you add filters (by date created, by taxonomy term, etc.), designate displays (block, page, etc.), and theme the output (at the display level, at the row level, etc).

A lot of the power of Views stems from the fact that it integrates with lots of other modules. It compliments CCK especially well, by allowing you to flexibly output CCK fields, as needed. And there are lots of other modules that add additional display types, such as lightbox slideshows, "accordions", CSV exports, JSON output, carousels, calendar, etc.

In short, if you plan to use Drupal, time spent learning to use Views will be time well spent.

like image 43
Matt V. Avatar answered Dec 31 '22 15:12

Matt V.