Podemos usar algo como:

{{  path('entity.node.canonical', {'node': node->id()}) }}


fuente: https://www.drupal.org/node/2352331

Primero debemos crear un Controller que sea el que devuelva el json para rellenar el autocomplete.


namespace Drupal\banners\Controller;

use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Component\Utility\Unicode;

$get_authors = function()
$_ = [];
foreach ( \Drupal::routeMatch()->getParameter('node')->get("field_autor")->getValue() as $target ){
$_[] = Node::load( (int) $target['target_id'] )->title->value;
return $_;

This a very common and basic task we can accomplish easily with DrupalConsole.
We need to have a custom module which contains the code for the following items:

  • A controller for giving a url to our HelloWorld page
  • A routing file in which the that url is related to the class of the controller

All of this can be quickly done with the DrupalConsole command generate:controller , but first let's generate our module

DrupalConsole is not only intended for developers. It also can be useful for site builders, themers or sysadmins.

In this short post we'll see a basic task, intended for site builders: creating a new block with an image inside. It can work as a banner or any badge you want to show in your site.

Ok, let's go.
First, we need to create a module for attaching to it the Banner Block code.


I usually try to translate DrupalConsole & its book every new version comes out because i mantain the spanish translation of DrupalConsole.

First of all, the best is to synchronize new strings with the following command:

drupal translation:sync

Then you want to

drupal translation:clean

for removing not already necessary strings.

The best way to check fresh changes is doing a pull and executing:

Resulta que es posible utilizar la arroba para especificar un sitio en DrupalConsole en lugar de --target a la manera en la que se indican los aliases en Drush.

Así, un comando como el siguiente es perfectamente válido :D
drupal @blog.local cr

These are my top 10 preferred Drupal Console commands in my daily use with Drupal 8:

  1. drupal cr all

    Rebuilds the chache

  2. drupal module:install -y module_name

    Download & install a given module.

  3. drupal module:uninstall -y module_name

He estado curioseando con Robo, un ejecutor de tareas al estilo de Gulp pero en PHP.
En el entorno javascript es muy común compilar el javascript o el css según se van produciendo los cambios en el código.
He conseguido hacer lo mismo utilizando Robo y DrupalConsole.
DrupalConsole puede borrar la caché del sitio con el comando
drupal cr all

Suscribirse a