entity_weight
Adds a weight field to any Drupal entity type — nodes, taxonomy terms, media, paragraphs, block content — for custom ordering via drag-and-drop or manual weight assignment.
Most Drupal sites need to control the display order of content beyond the default chronological or alphabetical sort. While core provides sorting by date, title, or sticky flag, there is no built-in mechanism to assign a custom weight to taxonomy terms, media items, paragraphs, or other entity types. Entity Weight fills that gap: it provides a configurable integer weight field that can be attached to any fieldable entity type, giving site builders and editors full control over display order from a single, unified interface — no custom code required.
Features
- Works with any fieldable entity type: nodes, taxonomy terms, media, paragraphs, block content, and custom entities.
- Admin UI at
/admin/config/entity-weightto enable or disable weight per entity type and bundle with a single checkbox. - Drag-and-drop ordering interface at
/admin/structure/entity-weightwith per-bundle tables. - Configurable weight range (default −100 to 100).
- Smart field widget: displays a number input for large ranges or a select dropdown for small ranges (≤ 40 options).
- Hide weight widget setting (enabled by default) keeps the field invisible on entity edit forms while preserving its value — no data loss when editors save content.
- Paginated ordering table (50 entities per page) so the interface stays fast even with thousands of entities.
- Include/exclude unpublished entities toggle — works generically with any entity type that implements a published status.
- Multilingual support: weight values are translatable and the ordering interface filters by the current language.
- Batch processing when saving order changes to avoid memory issues on large data sets.
- Dynamic admin menu links generated automatically for every enabled bundle.
- Compatible with Views: use
field_entity_weightas a sort criterion in any view. - Clean uninstall: all fields and field storage are removed automatically when the module is disabled.
Post-Installation
- Navigate to Administration → Configuration → Entity Weight (
/admin/config/entity-weight). - Set the minimum and maximum weight values (default: −100 to 100).
- Expand each entity type section and check the bundles you want to enable (e.g., Content → Article, Taxonomy → Tags, Media → Image).
- Optionally toggle Include unpublished entities to show or hide unpublished items in the ordering interface.
- Click Save configuration. The
field_entity_weightfield is created automatically on every selected bundle. - To reorder entities, go to Administration → Structure → Entity Weights (
/admin/structure/entity-weight) and select a bundle. Drag rows to reorder or type a weight value directly, then click Save order. - By default the weight field is hidden on entity edit forms. To make it visible so editors can set weight while editing content, go to the bundle's Manage form display, click the gear icon on the Weight field, and uncheck Hide weight field.
- In Views, add
field_entity_weightas a Sort Criteria (ascending = lightest first) to order listings by weight.
Clear caches via drush cr or Administration → Configuration → Performance if menu links or settings do not appear immediately.
Additional Requirements
This module requires no external libraries or third-party APIs. The only requirements are:
- Drupal core ^10.1 || ^11
- Drupal's Field and Field UI modules (included in core and enabled by default).
Recommended modules/libraries
I also maintain and recommend the following modules. None of them rewrite or override Drupal's core output — they integrate cleanly with the existing system and extend its native capabilities:
- CKEditor Advanced Container — Insert flexbox-based multi-column layouts directly inside CKEditor 5 text fields, with per-column responsive controls and no theme dependency.
- CKEditor Media Image Style — Adds a style selector button to the CKEditor 5 media toolbar so editors can choose an image style per embed without creating new view modes.
- CKEditor Media Title — Lets editors set a custom title attribute on media images embedded through CKEditor 5, directly from the media toolbar.
- Media Reference Override — Extends Drupal's standard media reference field to allow per-reference overrides of fields like alt text or title, storing the override on the referencing entity.
- Advanced Image Media Attributes Formatter — Exposes additional HTML attributes (alt, title, class, etc.) as configurable options in image field formatters.
- Logo Image Enhanced — Extends Drupal's built-in site logo handling with additional image field controls.
- Htaccess — Provides a UI for managing .htaccess rules directly from the Drupal admin interface.
Similar projects
- Node Weight — The original weight module for Drupal, providing drag-and-drop ordering and a weight field for nodes. It is a solid, well-tested solution. However, it only works with node entities. Entity Weight was inspired by Node Weight and extends the same concept to any fieldable entity type — taxonomy terms, media, paragraphs, block content, and custom entities — using a single unified interface. It also adds pagination for large data sets, a smart widget that switches between select and number input based on range size, and a hide/show toggle to keep the field invisible on edit forms without losing data.
- Weight — Another node-only weight module with similar functionality. Same limitation: does not support non-node entity types.
- Draggable Views — Adds drag-and-drop reordering to Views results. It works with any entity type shown in a View, but stores sort order in its own database table rather than as a field on the entity. Entity Weight stores the weight as a standard Drupal field (
field_entity_weight), making it queryable, exportable, and usable in any context without requiring a View.
If your project only needs node ordering, Node Weight is a proven choice. If you need weight-based ordering across multiple entity types from a single module, Entity Weight is designed for that purpose.
Supporting this Module
This module is developed and maintained by Nelo.
The maintainer is available for professional consulting and architectural guidance related to Drupal entity systems, custom ordering solutions, production implementations, and enterprise content architecture.
- Check out our sponsor, Dom Host Seo, who made this module possible with their support!
Community Documentation
Currently no external videos or demo sites are available. The module includes detailed help text accessible via Help → Entity Weight.
For questions, bug reports, or feature requests, please use the issue queue on Drupal.org.