Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom CTypes: Position in type dropdown

Is there a "quick" way to change the sort order of new content elements in the type dropdown? It seems, that new content elements are pushed to the end of the array, so they appear at the end of the list.

Current position (at the end of list):

enter image description here

Should be:

At the end of group "Standard".

enter image description here

Question:

Is is possible to register a content element to a specific group like "Standard" or "Lists" or a new group?


P.S.: Content element registered correctly in TCA/Overrides/tt_content and in Page TS Config for Wizard. Let me know if the code should be relevant, I will add it then.

like image 744
Mikel Wohlschlegel Avatar asked Aug 29 '26 04:08

Mikel Wohlschlegel


1 Answers

Try out ExtensionManagementUtility::addTcaSelectItem() and see argument #3 and #4.

If I want to add a custom group at a certain position, I usually loop over $GLOBALS[TCA][tt_content][CType][config][items] and place it in the right position, if the API is not sufficient in some cases.

like image 124
Benni Avatar answered Aug 30 '26 17:08

Benni



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!