11.06.2026 | Michael Ebert

Change the order of local tasks

my_module.module
function my_module_local_tasks_alter(&$local_tasks) {
  if (isset($local_tasks['entity.section_library_template.collection'])) {
    $local_tasks['entity.section_library_template.collection']['weight'] = 110;
  }
    
  if (isset($local_tasks['feeds.admin'])) {
    $local_tasks['feeds.admin']['weight'] = 120;
  }

}

Issue:

You are dissatisfied with the order of the local tasks (tabs) and want to rearrange them. If you have a view with multiple displays, it is easy to reorder the tabs by adjusting the order of the view displays. In my case, I have different views that provide the tabs for routes starting with "/admin/content".

Solution:

Change the weight of the local tasks. In my example, I have the the Layout Builder Library and the Feeds module installed. I chose these two to explain where you can find the local task you need to adjust the weight.

For the Feeds module, we needed to look up where the route "admin/content/feed" is defined. We will find it inside the routing.yml file of the module. It is defined under feeds.admin.

The Layout Builder Library Module defines the route we are looking for (admin/content/section-library) in the annotation of the entity. The route name can be found in the links.task.yml file. It is defined as entity.[entity_id].[link].

Weitere DevBits

21.11.2025 | Peter Majmesku

PHP 8.5 New Features: Pipe Operator and URI Extension

The New URI Extension

php_8.5_examples_uri_extension.php
<?php

##### URI Extension #####

// PHP 8.4 way

$components = parse_url('https://php.net/releases/8.4/en.php');

var_dump($components['host']);
// string(7) "php.net"

// PHP 8.5 URI Extension

use Uri\Rfc3986\Uri;

$uri = new Uri('https://php.net/releases/8.5/en.php');

var_dump($uri->getHost());
// string(7) "php.net"

The New Pipe Operator

php_8.5_pipe_operator.php
<?php

##### Pipe Operator #####

// PHP 8.4 way

$title = ' PHP 8.5 Released ';

$slug = strtolower(
    str_replace('.', '',
        str_replace(' ', '-',
            trim($title)
        )
    )
);

var_dump($slug);
// string(15) "php-85-released"

// PHP 8.5 Pipe Operator 

$title = ' PHP 8.5 Released ';

$slug = $title
    |> trim(...)
    |> (fn($str) => str_replace(' ', '-', $str))
    |> (fn($str) => str_replace('.', '', $str))
    |> strtolower(...);

var_dump($slug);
// string(15) "php-85-released"
php
13.11.2025 | Dominik Wille

Don't list a widget for a field type.

CustomWidget.php
  public static function isApplicable(FieldDefinitionInterface $field_definition) {
    if (isset($field_definition->getDisplayOptions('form')['type'])) {
      return $field_definition->getDisplayOptions('form')['type'] == 'slot_content_weights';
    }

    return FALSE;
  }

php
widgets
fields