Skip to content

vasi/event_sort

Repository files navigation

event_sort

This is an example implementation of a custom Drupal views sort handler. See my blog post for more details.

It's meant to sort events in a way that shows users the most interesting events first:

  • Future events come before past events
  • Events closest to today come before events far in the past or future

Correctly sorted view

Usage

Note that this is a sample of a custom module. The hook_views_data_alter() assumes the field name is field_event_date, but that's unlikely to be the right field for your site.

However, the sort handler is generic, so you could easily write a custom hook_views_data_alter() that applies it to a different field or property.

About

Drupal module for custom views sort of events

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages