Sort paragraph names alphabetically in node add/edit form

Created on 20 July 2016, almost 8 years ago
Updated 2 December 2023, 7 months ago

Is it possible to sort paragraph adding list alphabetically based on Paragraph name (not machine name if thats what is currently used)?

See the attached image, for what is happening currently.

I expected the following order on the dropdown:

  • 1 Column
  • 2 Column
  • 3 Column
  • Accordion
  • Block
  • Call to action
  • Customer Testimonial
  • Featured Content
  • Header Image
  • Image Left Text Right
  • Image Right Text Left
πŸ’¬ Support request
Status

Fixed

Version

1.0

Component

User interface

Created by

πŸ‡¦πŸ‡ΊAustralia realityloop

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States webdrips

    For me, the dropdown list wasn't even sorting by the weights set, and I had to set my custom module weight to 12 (one higher than paragraphs) to get the following code working:

    ...
    switch ($form_id) {
      case 'blah':
        $field = 'field_blah';
        break;
    ...
    }
    
    if (isset($form[$field]['widget']['add_more']['add_more_select']['#options'])) {
      natsort($form[$field]['widget']['add_more']['add_more_select']['#options']);
    }
    ...
    
  • πŸ‡ΉπŸ‡­Thailand manarak

    I want to fix the same issue.
    Why is this issue marked as "fixed" ?
    There is no patch.

Production build 0.69.0 2024