Closed (fixed)
Project:
Paragraphs
Version:
8.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Jul 2016 at 23:08 UTC
Updated:
27 Mar 2026 at 14:34 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
johnchqueYou can change the weight(order) of the elements of the add button on the field settings form.
Comment #3
miro_dietikerSo yeah, sequence is persisted in paragraphs widget settings.
If you have many paragraph fields, that's a bit of redundant configuration... But i don't see how we could additionally simply maintain a global sequence...
Comment #4
realityloop commentedthanks.
Comment #6
dennis cohn commentedMaybe its better to order them alphabetically by default?
It's not logic to show them randomly.. right?
Comment #7
matheuslbarros commentedI used something like this (where field_items is the name of the field):
Comment #8
rpsuI would indeed be good UX to have the items optionally sorted alphabetically. Especially with long list of paragraphs on multilingual sites it would improve admin UX.
While the hook in #7 solves this, having a checkbox in the field settings would be a good feature to have.
Comment #9
rpsuComment #10
ras-ben commentedIn my case, where I'm using the 'add more' modal, I use this code:
Comment #11
joachim commentedWe have a LOT of paragraph types on our project -- one field on a node has 34 types enabled. Using the manual sort order isn't convenient, as every time a new type is added, a developer would have to make sure it's moved into alphabetical order.
I would be inclined to add this as a setting on the form widget, with a note in the description for the setting's form element that it overrides the manual order in the field configuration.
Could this be reopened please?
Comment #12
mhmhartman commented+1 for a form display option to display the selected paragraphs in (alphabetically) ordered fashion. With many paragraphs it's a must have IMO.
Based on ras-ben's answer in comment #10 I could sort my 'add paragraphs' select list, however I needed to make some modifications in order to make it work and prevent errors:
Comment #13
chrisla commented+1 for this for reasons listed in 11 and 12 above. whenever dealing with lots of paragraphs and a few different paragraphs fields, manually setting the order for them each time is a genuine pain
Above ideas for form_alters do not work for paragraph fields nested within paragraph fields
Comment #14
trishen commentedComment #15
webdrips commentedFor 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:
Comment #16
drupaldope commentedI want to fix the same issue.
Why is this issue marked as "fixed" ?
There is no patch.
Comment #17
jaydarnellThis issue needs to be reopened.
Comment #18
drupaldope commentedwho is closing unresolved issues, especially lying by marking it as "fixed" ?
Comment #20
ninobrownh20 commentedYou can also find your field config for the paragraph field and manually sort the paragraph names in the field target_bundles setting.
The important part is the weights under target_bundles_drag_drop
Comment #21
mlncn commentedIt'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.)
Comment #22
anybodytotally agree with @mlncn, that would be super helpful. Maybe sorting by JS in the UI would be enough and a lot simpler?
@mlncn would you maybe like to create a follow-up for that?
Comment #23
emil stoianov commentedAs ninobrownh20 said the config is exported with target_bundles_drag_drop already sorted alphabetically.
The weights actually are used to display the order in the widget
To easily achieve alphabetical sort just replace the weights with 0 for all paragraph fields
Do do that I search whole config folders for "handler: 'default:paragraph'" - not sure if this is a reliable enough to get them all...
Then for each file search with a regular expression
^(\s*weight:\s*)-?\d+And replace with
$10After that
drush config-import