0

I need a somewhat complicated view setup. I don't know if I can even do it with views...

I have a page, we'll say the url is "/example". When a user hits "/example", they'll see a main content area and a sidebar. The main content area has a list of nodes. The one requirement I can't seem to figure out is how to have this list be limited by time, rather than number. I want the last 3 months of nodes to show up, not a set number.

Then in the sidebar is an "archive" view (seems best to me to just have it be a separate view from the main one, even though it concerns the same content) where the years should be listed (if they have nodes) and under each year the months should be listed (again, only if they have nodes).

Such as:

2012
February
March
2011
April
December
2010
January

I see an example "archive" view in the default views, but it's not quite set up like this.

I know views is very capable, but can it do this?

1
  • 1
    For your main content, in Filters, you can select a Date filter and then use the node post or last modified date. If you select Month as the granularity, you can then select a relative date by entering now - 3 months in the relative date field and the operator is greater than.
    – Jimajamma
    Commented Jun 27, 2012 at 15:39

1 Answer 1

2

For the second view , I think it's possible using agregation : you will have to select two times the field dates , the fist one will be displayed as year and second one month , then use group by the first date field. If it doesn't work then in the fields settings you will have to separate the date as one field for year , and one field for month , then you will have to group by the year field in the views.

Here is a great tutorial from nodeone.se of how to use agregation in drupal 7 :

1
  • Just updating this excellent answer, tutorial videos: video1, video2
    – pinueve
    Commented Oct 25, 2015 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.