Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. node.module

function node_preprocess_block

Implements hook_preprocess_HOOK() for block templates.

File

core/modules/node/node.module, line 244

Code

function node_preprocess_block(&$variables) : void {
    if ($variables['configuration']['provider'] == 'node') {
        switch ($variables['elements']['#plugin_id']) {
            case 'node_syndicate_block':
                $variables['attributes']['role'] = 'complementary';
                break;
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal