- ๐บ๐ธ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']); } ...
I want to fix the same issue.
Why is this issue marked as "fixed" ?
There is no patch.who is closing unresolved issues, especially lying by marking it as "fixed" ?
- First commit to issue fork.
You can also find your field config for the paragraph field and manually sort the paragraph names in the field target_bundles setting.
settings: handler: 'default:paragraph' handler_settings: target_bundles: accordion_section: accordion_section anchor: anchor article_listing: article_listing background_section_break: background_section_break buttons: buttons card_gallery: card_gallery card_grid: card_grid collection: collection
- ๐บ๐ธUnited States mlncn Minneapolis, MN, USA
It's fair for the maintainers to say the support request here is fixed, but i agree there should be a feature request opened to make it easy to alphabetize paragraph types.
If you go to any taxonomy administration page for any vocabulary (for example /admin/structure/taxonomy/manage/example/overview ) it will have a re-orderable list of terms, and there is also a "Reset to alphabetical" button at the bottom.
Paragraph configuration pages should have the same option, probably.
(That button goes to a confirmation form, which ultimately invokes this resetWeights() method, which actually simply removes the weightsโ with the presumption that terms everywhere will be ordered first by weight ascending, and then alphabetically by label, so that when they are all zero the alphabetical order is used by default. That would be a great model for Paragraphs to follow with paragraph types, if possible. But againโ a new issue should be created.)