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

allennicol (not verified)

Thu, 08/10/2017 - 08:13

Read writing services review for finding good service for your need. So you should have to be done your essay works by taking helps from those services that are available now for students.Each and every services have most qualified writers and they were spent their life for students. They were creating new ideas and tips for making your essay perfect. Its better for all of you to start your essay with quotation of famous writer’s,it will attract reader’s attention very quickly and you can use it direct manner from title of essays. Good voice and excellent structure of your essay gives a perfect essay and you can perform well at your university competitions easily. Visit custom essay writing service (https://www.essayguardian.com/) for getting a interesting tips to make your essay excellent one. For preparing well structured essays, you have to study the better details such as how to write narrative, persuasive and expository essays. Its better to perform well by taking detailed notes and search on available source. Write down your essay in an effective way and make good impression at all the readers, such as kids, youngsters and also others.

mert34 (not verified)

Wed, 08/16/2017 - 23:34

Wow! Thank you! I continually wanted to write on my site something like that. Can I take a portion of your post to my site?… sexmag

Add new comment