Change Drupal 8 'Powered By' block | Drupal 8

Change Drupal 8 'Powered By' block

Submitted by editor on Tue, 05/31/2016 - 13:30
Question

How to edit the Drupal 8 system's "Powered By" block ?

You can't change the body of this block fron the user interface. But you can do that using a small custom module using hook_block_view_alter().

Example: in the yourmodule.module

function yourmodule_block_view_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) {
  if ($block->getBaseId() === 'system_powered_by_block') {
    $build['#pre_render'][] = '_yourmodule_block_poweredby_prerender';
  }
}

function _yourmodule_block_poweredby_prerender(array $build) {
    $build['content']['#markup'] = 'Your text';
    return $build;
}

Then clear the cache

NOTE: You can also remove the system 'Powered by Drupal' block and replace by a custom block.

Comments

Best essay wri… (not verified)

Wed, 04/26/2017 - 09:00

Nice share. Thank you for giving such an useful information. The giving information are more useful for the users. Really very interesting to read the article. You can present the information very simple and easy to understand it. You can do it a good job. The article includes detailed information about the editing the Drupal8 system. I am working with different websites and but it is not of Drupal. I am a writer and also deal with on my profession to spread more ideas and tips to develop and works through best essay writing service

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.