views:

31

answers:

2

I have a blog section in a drupal website, built with Views. I want to add a sidebar with month navigation (as in each mont is listed with the number of posts, etc). How can I do this, preferably with Views?

A: 

Have you tried the Date/Calendar modules?

http://drupal.org/project/calendar

Kevin
+1  A: 

Drupal views can create views which allow you to select and list or summarise lists of nodes by various fields including the date related fields. You can do this by adding an argument, and then setting how the view behaves when no argument is supplied.

Are you looking for something along the following lines?

March 2010 (3)
February 2010 (12)
January 2010 (7) ... etc.

Create a view called Monthly Summary, and add an "argument" 'Node: Created year + month'.

Then use the options on the argument to select the 'action to take if argument is not present'. Select 'Summary, sorted descending' to create list with most recent month at top.

Watch out for sorting issues - this choice of how you sort the monthly summary in the argument settings will override the usual views sort order. This caught me out for a while.

digitalsean
Thank you sean, this sounds more or less like what I need. I will try it and see how it goes
0al0
Ok, I've configured the argument as you told me, but now I have no idea how to display the list of months with the post count for each one, and an hyperlink in each month to provide the argument.Could you please give me some advice? Thank you
0al0
Hi Oalo, it sounds like you have created a new view and set up all the defaults. A single view can be displayed in several different ways based on same set of default parameters. From the view select the dropdown 'block' and click 'add display'. Remember to save the view and head over to admin / blocks to drag and drop the new block into place and set which pages the block appears on. There is some documentation on views at http://drupal.org/project/views/and more useful information at http://views-help.doc.logrus.com/
digitalsean

related questions