2

I have a student project View that I want to filter by year using a date field.

I would like to find a way to have the years appear as links or a menu at the top.

I have tried the Better Exposed Filters module but I don't get the option to display the year as links with a date field.

I have tried making a block view which has the date field rewritten as a link with it's token value(/2010) as well as a contextual filter on the date field .

This works except I get as many 2011's as there are values for 2011.

Is there something I could do with glossary mode?

Anyone know of a way?

1

You are almost there: you have to group your results by the year field. In the settings of your display format just pick a grouping column:

enter image description here

  • Thank you Alex, I am still not quite there, because now I have group headings with repeating values below each. Views won't allow me to exclude the year from display but still group by it (because it is the only field). But this gave me a working "solution", I am just hiding the view rows with css for the time being. – mollybt Apr 23 '12 at 21:32
  • Awesome, you an always override the template to hide the titles in a less hackish way than through CSS. – Alex Weber Apr 26 '12 at 22:05
0

Sadly, I don't believe the BEF module has the ability to display dates as links, but you can create a custom block and use drupal functions to create links that will work with it.

And if you do go this route you can switch from exposed filter to a contextual filter and utilize cleaner URL's and core Views functionality for re-writing the page title, breadcrumb, etc.

  • Thank you Johnathan, I had a feeling it's possible with views/contextual filters, will figure it out someday. – mollybt Apr 23 '12 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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