New answers tagged

3

Get the site name from config and add the config as cacheable dependency so that the block gets updated when you change the site name. public function build() { $config = \Drupal::config('system.site'); $build = [ '#markup' => $config->get('name'), ]; $renderer = \Drupal::service('renderer'); $renderer->addCacheableDependency($build, ...


3

This can be done with Drupal 8's Layout Builder. Layout Builder is a module in Drupal 8 core that does much of what Panels did in Drupal 7 and before-- it allows you to create arbitrary layouts consisting of fields and blocks for content types and even individual pieces of content. Since its part of core, this should be a safe long-term solution to rely on. ...


0

To be able to configure blocks to show up or not show up based on URL parameters (same as you can for the URL path in Drupal core) use condition query module for Drupal 8 or block query for Drupal 7.


0

This turned out to be a conflict with the songkick module. I'm a maintainer so I'll make sure the issue is handled and post further updates in the issue cue on Drupal.org here.


0

You probably are confusing {{ header }} and {{ view.header }}. The first prints the header section including the block: views-view.html.twig {{ header }} The second one returns ViewExecutable::$header, an array of handler plugins you have configured in the View. You can try to extract configured string values like in the first example but in case of a block ...


Top 50 recent answers are included