This module provides an ordered list form element and field widget. In contrast to other list elements/widgets, the ordered list preserves the order of the selected items.
Field widget is available for all built-in list field types.
Form element example:
$form['list'] = [
'#type' => 'ordered_list',
'#title' => t('List'),
'#title_display' => 'invisible',
'#description' => t('Description.'),
'#options' => [
'item1' => t('Item 1'),
'item2' => t('Item 2'),
'item3' => t('Item 3'),
'item4' => t('Item 4'),
],
'#default_value' => ['item4', 'item2'],
'#required' => TRUE,
'#disabled' => FALSE,
'#labels' => [
'items_available' => t('Available'),
'items_selected' => t('Selected'),
'control_select' => t('Select'),
'control_deselect' => t('Deselect'),
'control_moveup' => t('Move Up'),
'control_movedown' => t('Move Down'),
],
];
Installation
- Install as usual, see https://drupal.org/node/2781613 for further information.
Credits
Current maintainers:
- Alex Zhulin (Alex Zhulin) - https://drupal.org/user/2659881
Supporting organizations:
Project information
- Project categories: Site structure
106 sites report using this module
- Created by alex zhulin on , updated
Stable releases for this project are covered by the security advisory policy.
Look for the shield icon below.
Releases
8.x-1.6
released 20 March 2023
Works with Drupal: ^8 || ^9 || ^10
Install:
Development version: 8.x-1.x-dev updated 20 Mar 2023 at 12:31 UTC

