This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# Check if a field has a value before printing it #} | |
{% if node.field_name.isEmpty == false %} | |
<p>{{ content.field_name }} </p> | |
{% endif %} | |
{# Check if block is empty #} | |
{% if block('block_name')|trim is not empty %} | |
<div>{% block block_name %}{% endblock %}</div> | |
{% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Drupal\Core\Cache\CacheableMetadata; | |
use Drupal\Core\Template\Attribute; | |
use Drupal\Core\Url; | |
use Drupal\node\NodeInterface; | |
use Drupal\Core\Link; | |
/** | |
* Implements hook_preprocess_page() for page.html.twig. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Drupal\block\Entity\Block; | |
use Drupal\block_content\BlockContentInterface; | |
/** | |
* Implements hook_theme_suggestions_HOOK_alter(). | |
*/ | |
function HOOK_theme_suggestions_page_alter(array &$hooks, array &$vars): void { | |
$constrained = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extend an existing library: | |
# Ensures overrides are only added when the toolbar is available. | |
libraries-extend: | |
toolbar/toolbar.menu: | |
- my_theme/drupal | |
# Replace or remove entire libraries; | |
# Un-comment each library to exclude it's CSS, JS and Dependencies from being loaded. |