Drupal Archive List

Wordpress users are used to having an archive list for their blog. They want to be able to have all the posts from the past listed by date so that they can have their users see back posts.

Drupal 6, by default, does not allow for this functionality. In order to resolve that, you have to install and configure the Views module appropriately. In order for this tutorial to work, make sure that you download Views from its project page at Drupal.org. Make sure that you enable all three options from Views on your modules page (http://www.example.com/admin/build/modules).

Here are the next steps.

  1. After Views has been installed and turned on, you can go to the Views page located on your site (http://www.example.com/admin/build/views). If you have any problems at all with this, you can try to use the import function in step 18.
  2. You should see a number of default views listed. You should see an option that looks like this:
    archive view
  3. When you find that view, you can click on the “enable” and it will look like this:
    archive enabled
  4. You may consider this good enough and skip to step 15, but there is a problem with this. First, it will show all of your content types in the archive list. That means if you have custom content types like webforms and general pages, you won’t have a list of just your blog posts. The next problem is that if you set something to appear in the future, it will also show in the archive list. To resolve this, click the Edit button on the archive view. (I’ll show you the most basic settings)
  5. I like for my pages to have titles. So, the first thing I do is set the title. I will set the defaults whenever possible so that I don’t have change the various settings. With that in mind, leave the defaults on the left selected and click on the title.
    views title
  6. After you have clicked on the title, scroll down and you will see this field where you can put any title you want. You can see that I have entered “Archive”:
    views title input
    Then click update and it will update the page for you.
  7. Next, we want to make sure that only the blog posts (or whatever content types you want) are visible. You’ll need to add a new filter, so click this button:
    views add filter
  8. When you have clicked the add filter button, you can scroll a little to the options for adding a filter. If you pull the groups down to “Node”, it is a little easier to find the “Node: Type” filter.
    add node type filter
    Click the “Add” button.
  9. Select which posts you want to appear (or select the other radio button for which posts not to appear) and then click “update”
    update the node filter
  10. We also want to make sure that only items published items from the past. The default publishes all the posts… even if they are in the future. (note that you can do this at the same time as steps 8 and 9, but I prefer to do them separate to avoid confusion). You’ll need add another filter.
    add another filter
  11. This type, select the “Node: Post Date” and click “add” filter:
    add node post date
  12. Now you need to configure the filter by selecting the radio button for “is less than or equal to” and for “an offset from the current time…” You’ll then need to put in a value of +1 minute.
    configure date filter 
    Click “update”
  13. Make sure that you now click the “Save” button
    save
  14. If you go back to your list view of all your views (http://www.example.com/admin/build/views) you will notice that the “Node view” indicates it is overridden:
    overridden node view
  15. If you would like for the block to appear in the sidebar, you can now go to configure your blocks and put it anywhere you want (http://www.example.com/admin/build/block):
    archive list block
  16. To see the page that is your archive list, you can go to the Archive path. (http://www.example.com/archive). You can use CSS to design this page anyway you want.
  17. To see an example of this in action, you can go to http://www.masterthebusiness.com/archive. Notice the right sidebar at the bottom has a full list of all items.
  18. If you would like to use exactly what I have done for the blog at MasterTheBusiness.com you can simply use the import tab at the top of the views page (http://www.example.com/admin/build/views) and use
    this file (right click to save to desktop... it is easier to copy all the code that way)
     as the import view code:
    import view