By leisurman on
I want to reorder the list of available content types on the create content page.
I have node-add-list.html.twig and entity-add-list.html.twig inside my custom theme template folder.
Twig then outputs the array of all types or bundles/content types in alphabetical order. How can I sort this a different way? And can I hard code the links I want in this file or can I output each content type individually?
Comments
=-=
to reorder items in node/add you'll want to reorder the menu items in your main menu under the add content parent.
Thank you. I see that now. I
Thank you. I see that now. I went to Administration menu and changed the order and saved it. The order is saved but If I look at the /node/add/ page it still has the old order? This could be a Drupal 8 bug. I tested this in Drupal 7, I went to the
Navigation menu and changed the order, then went to /node/add/ page and the new order is displayed.
Sort order on /node/add page in D8
Hi,
I'm having the very same issue. Did you ever find a solution for this?
I'm also looking into it
I ended up hacking core.... sorry, I know it's the forbidden sin, but I have no idea how to override it otherwise...
This didn't work for me
This didn't work for me. Any option?
I know the last comment was a
I know the last comment was a couple of years ago but this can be achieved using template_preprocess_node_add_list() - https://api.drupal.org/api/drupal/core%21modules%21node%21node.module/fu...
Note that this also works as a hook within a module (in case you are using an admin theme that you didn't create)