Hello,

I build a website with a few static pages with Drupal.

I would like to create a blog page which gathers all the blog entries. This blog page is NOT the home page. On my site, I have enabled the blog module and I can create blog entries. However, how do I make all the blog entries show up on the blog page and have them organized chronologically?

Thanks in advance for your help!

Comments

ytin’s picture

Use the "Views" module to do it.

t-wins’s picture

I am new to Drupal. Would you mind providing some details as to where to start? Any online guides for this?

Thanks in advance!

aniuj’s picture

http://drupal.org/project/views
It takes time to learn how to use this module. I am also new to the module at this moment.

RichieRich’s picture

Right, here we go:

1) Firstly you need some way of identifying your node as being a blog post. You could use Taxonomy for this but rather than introducing that at this point I'd suggest that you create a new content type called 'Blog' (or perhaps 'Blog Entry').

2) Now that you've got your new type create a few instances of it. This will provide you with some blog entries to display in views. Just create 3 or 4 for test purposes.

3) Install the views module if you haven't already.

4) Views overview: Views can be incredibly confusing when you first look at it but in actual fact it's pretty easy to use once you grasp the basics (it took me a while to figure out what it was even for!). Basically it provides an interface which is used to design sets of queries which in turn will be used to build the contents of a page. You are creating a certain 'view' of your nodes which is specific to your requirements. In this case we'll be creating a 'view' of your blog entries, and nothing else.

From here on well be creating your view:

5) Go the views main page which lists all the views. From my administration module menu this if found at side building -> views

6) Click 'Add'. This will kick off the process of designing a view

7) Give the view a machine readable name and a human readable name. You don't need to bother with the 'view tag'. Select 'Node' as the 'View Type'. Click Next.

8) This is the fun part. We're going to start putting the view together. You'll be on the Edit view page at this point and it will be displaying 'Default' settings for the view. A quick explanation of what's going on here may help....

A single 'view can actually be used to create multiple 'displays'. I guess you could think of each of these displays as being some content which you position on your site. An individual view can create pages, blocks (which you can position anywhere) or RSS feeds. In this tutorial you're going to create a Page (but not yet!). The 'Default' tab allows you to define criteria which is common to all of these individual displays, thus saving you from having to enter all the info over and over again for all of them. On it's own the 'Default' information does nothing. You have to add a display to use it.

9) Define the default view by defining the following attributes. (you click on them to modify them. When you click an edit box appears at the bottom of the view).

10) 'Title': Provide a title for this view. (type it in the box below which says 'Defaults: the title of this view' and click 'Update'.

11) 'Row Style'. Click on the 'row style' text. At the bottom you'll get the option to style the view as a node. Select Node.

12) Once you've doen this you'll have the optioin to display the entire node or just a teaser in the view. I always go for 'teaser' but I explicitly define a teaser section within each node. Drupal can generate previews without teasers being defined however, but it can look messy at times. Click whichever suits your requirements under 'Build Node'.

13) 'Items to display'. I leave this at 10, but update it to however many blog entries you wish it to display on a give page

14) 'User pager'. Select yes if you want to see a pager at the bottom of the page if there are more than 10 blog entries. Full pager should be fine.

15) 'Sort criteria' (over on the top right). Click the little '+' symbol. You'll see a blox called 'Defaults add sort criteria' pop up below. Under 'Groups' select 'Node'. This will filter down the options. Select Node 'Published'. Click 'add'. This allows you to order nodes in the display in accordance with the date which they were published. Select Ascending or descending depending on your requirements and click 'update'.

16) Filters'. You only want to display blog entries so we need to filter out everything else. Go to 'Filters' which is just below 'Sort Criteria'. Click '+' and then under 'Groups' select 'Node' again. This time select 'Node Type' as the basis for the filtering. You'll then be presented with another selection. Select 'Is one of' (should be selected by default) on the left and 'Blog' on the right (or whatever you've called your content type).

17) Okay, that's our basic view set up. If you scroll down the page you'll be able to see a preview of what will be displayed by the view by clicking 'Preview'. If you're not happy with the results then do some tweaking.

18) Okay, we're not fishished yet. We have your 'view' but we have no way of presenting it on your website. To do this you need to add a 'Page' to the view. Click the 'Add Display' button on the top left while ensuring that 'Page' is selected in the box above it. This will creat your page.

19) You'll now be viewing settings which are specific to the 'Page' which you've just created. This page inherits all the criteria which you specified in the 'Default' area. If you like you can refine or override this criteria at this point. For example, if your plan was to create lots of pages for different content types then you may have chosen to difine the 'Filter' here rather than in the defaults. This would enable you to have each page display different node types. However, all you need to do at this point is to define a 'Path' for your page. You'll see this under the 'Page' settings at the bottom of the display. Click on 'Path' and add your desired url, relative to the root. For example, you could just type 'blogs'.

20) Click 'Save' and your page is ready to view at the path which you defined.

Okay, that's it basically. There may be the odd small mistake / omission in there, but on the whole I think that it's correct. Views is very powerful, but hard to get your head around to start with, so I hope this helped.

Thanks,

Rich

ralexanderclark’s picture

This helped a lot

shv_rk’s picture

Hey Rich,

This is the best tuorial for views I have ever seen so far!

Thanks :)

ckeen’s picture

Rich, This was immensely helpful. Thanks a lot! Just what I was looking for.

Drupalace’s picture

Views is great for creating lists from any sort of content, but in your case I think you're already covered, without any use of Views. Drupal automatically creates a page for all blogs, and for specific users' blogs.

I don't think there are any special configurations needed, other than that the Blog module be enabled. Try the path /blog for a list of all blog posts, and /blog/username for a specific user's blog posts. Does that work?

===
Drupal Ace
Drupal overview for beginners: http://www.drupalace.com/drupal-for-beginners

kaiser ad’s picture

Just in case some one is looking for the same thing, I found this pdf is a great source of information.

http://learnbythedrop.com/system/files/Building_Your_Blog_With_Drupal_7-...

wscomn’s picture

The above link to learnbythedrop.com has been hijacked, taking you to a Viagra page. Sad, lol!
Here's the GitHub link to the actual document mentioned: https://github.com/utujam123/Blog_Modules_Drupal/blob/master/Building_Yo...
Cheers!