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
{# | |
/** | |
* @file | |
* Theme override to display buttons block field. | |
* | |
* Available variables: | |
* - attributes: HTML attributes for the containing element. | |
* - label_hidden: Whether to show the field label or not. | |
* - title_attributes: HTML attributes for the title. | |
* - label: The label for the field. |
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
/** | |
* Implements hook_preprocess_field(). | |
* | |
* Preprocess field--field-buttons-ref.html.twig. | |
*/ | |
function mycustomtheme_preprocess_field__field_buttons_ref(&$variables) { | |
// To render block content with block.html.twig template. | |
if (isset($variables['items'])) { | |
foreach ($variables['items'] as $item) { | |
if (isset($item['content']['#block_content'])) { |
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
<html> | |
<body> | |
<div class="region-content"> | |
<h2 class="title">Hello World!</h2> | |
<div id="block-block-1" class="block"> | |
Lorem Ipsum Uno <a href="http://www.redhat.com">Click me</a> | |
</div> | |
<div id="block-block-5" class="block"> | |
Lorem Ipsum Dos <a href="http://www.redhat.com">Click me</a> | |
</div> |