Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Views Sort By Options Weight

No security coverage Under active development 443 sites

Part of the Views ecosystem · 280 projects

This module allows you to define a custom order for options within list fields, entity bundles, or user roles when sorting views. It provides sorting plugins that let you assign a weight to each available option, ensuring specific items appear at the top or bottom of your sorted lists.

Adds Views sorting plugins that allow setting weight for each list field or entity bundle option.

For instance:
You have an entity with a "list" field, which we'll call "Status." The available options are:

new|New
canceled|Canceled
approved|Approved
need_feedback|Need Feedback

You want to sort the view display based on these options. However, entities with the status "Canceled" should appear at the top of the list, followed by "New," then "Need Feedback," and finally "Approved" at the bottom. This module can help you achieve that! See the "How to Use" section for more details.

Supported field types:

  • "List (text)" - list_string
  • "List (integer)" - list_integer
  • "List (float)" - list_float

+ Entity Bundle (Type)
+ User Role

How to use:

  1. Go to the Views settings form and choose one of the sorting plugins that have the "(set weight)" suffix.
  2. Set weight (integer number) for each of the proposed options

Similar projects and how they are different:

  • Views List Sort: offers similar functionality but doesn't allow to change the weight of available options; supports only "list_string" fields; doesn't support "type" (bundle) property.

Drupal 8–11

Ask your assistant about Views Sort By Options Weight

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • views Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Apr 2023
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Slowing

Release Timeline

Releases

Version Type Core PHP Release date
2.2.0 Stable 8–11 Dec 19, 2024
2.1.1 Stable 8–10 Jun 21, 2023
2.1.0 Stable 8–9 Apr 18, 2023