How to sort the content types/bundles on /node/create page 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?
You can do this in preprocess by overriding this code from node.module:

function template_preprocess_node_add_list(&amp;$variables) {
  $variables['types'] = array();
  if (!empty($variables['content'])) {
    foreach ($variables['content'] as $type) {
      $variables['types'][$type-&gt;id()] = array(
        'type' =&gt; $type-&gt;id(),
        'add_link' =&gt; \Drupal::l($type-&gt;label(), new Url('node.add', array('node_type' =&gt; $type-&gt;id()))),
        'description' =&gt; array(
          '#markup' =&gt; $type-&gt;getDescription(),
        ),
      );
    }
  }
}


Or you can replace the foreach loop in the twig template

node-add-list.html.twig

  &lt;dl&gt;
    {% for type in types %}
      &lt;dt&gt;{{ type.add_link }}&lt;/dt&gt;
      &lt;dd&gt;{{ type.description }}&lt;/dd&gt;
    {% endfor %}
  &lt;/dl&gt;


with a hard-coded list:

  &lt;dl&gt;
      &lt;dt&gt;{{ types.article.add_link }}&lt;/dt&gt;
      &lt;dd&gt;{{ types.article.description }}&lt;/dd&gt;
      &lt;dt&gt;{{ types.page.add_link }}&lt;/dt&gt;
      &lt;dd&gt;{{ types.page.description }}&lt;/dd&gt;
  &lt;/dl&gt;