Reversed content types in CreateContent block

Created on 21 March 2019, almost 6 years ago
Updated 22 January 2023, almost 2 years ago

Problem/Motivation

When looking at the CREATE NEW CONTENT block in the dashboard, I saw that the node types are shown in a reversed order. When looking in the code it's quite obvious why:

 $types = array_reverse(node_type_get_types());
 $links = [];
 $config = $this->getConfiguration();
 $destination = drupal_get_destination();
 $options = [
   $destination,
 ];

Source: https://cgit.drupalcode.org/varbase_total_control/tree/src/Plugin/Block/...

Is there any particular reason to do it like that?

Proposed resolution

Preferable would be probably to make the list sortable to prioritize the most relevant content types instead of relying on the machine_name. But just ignoring this (which would require another issue), I would propose o remove the array_reverse, which is confusing for authors, that are used to the order we see at /node/add

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Feature request
Status

Needs work

Version

9.0

Component

Code

Created by

🇩🇪Germany szeidler Berlin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024