Introducing the Views Module

The Views module is a very powerful way of displaying the content of your Drupal site in a flexible way. It acts like a customisable search engine which creates pages which always return the same kind of result. Say for example you wanted a page which showed all the Audio and Video entries of your site that were about a certain place and had been categorised in this way, Views would be one way of doing this.

Views has become very popular in the Drupal community partly because it is so flexible and you don't need to write any code to make it work. 

An example of View

Let's look at an example of a View. Point your browser to the admin page which lists views. 

/admin/build/views/list

In my set up there is a view which hasn't been enabled yet called Recent Comments.

a_views_drupal_1

The description of the View says that it 'Contains a blog and a page to list recent comments' the block will automatically link to the page, which displays the comment body as well as the link to the node.

To work out exactly what this means to us, let's enable the view. Click on the Enable link.

a_views_drupal_2

When you have clicked the enable link you see that there is Path: comments/recent link. We can click on that to see what our newly enabled view looks like.

a_views_drupal_4 

Well there's a surprise it gives us a list of our most recent comments.

In the description of the view it said that it also created a block listing the same content which we could use. If we enable the block on the blocks page by pointing our browser at the admin/build/block page and chosing a region for it appear in.

a_views_drupal_5


You need to Save these settings.

And you'll then see a Recent Comments blog in the Left sidebar.

a_views_drupal_6

In another chapter we'll look at how you create and modify your own views.



your comment:
name :
comment :

If you can't read the word, click here
word :