$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);
$block_manager = \Drupal::service('plugin.manager.block');
<?php | |
\Drupal::theme()->getActiveTheme()->getPath(); | |
?> |
<?php | |
// Load the currently logged in user. | |
global $user; | |
// Check if the user has the 'editor' role. | |
if (in_array('editor', $user->roles)) { | |
// do fancy stuff | |
} | |
?> |
<!DOCTYPE html> | |
<html<?php print $html_attributes; ?>> | |
<head> | |
<?php print $head; ?> | |
<title><?php print $head_title; ?></title> | |
<?php print $styles; ?> | |
<?php print $head_scripts; ?> | |
</head> | |
<body<?php print $body_attributes;?>> |