How to access the block ID in hook_block_view_alter()?

How can I access the block ID in hook_block_view_alter()? function mysite_block_view_alter(array &$build, \Drupal\Core\Block\BlockPluginInterface $block) { if (‘my-block-id’ == $block->maybe_there_is_some_method_that_returns_the_id()) { // Do something. } } Is there some way to inspect the $block variable? I’m finding that calling var_dump or kint inside of hook_block_view_alter() has no effect. Actually, I have not been able to confirm…

permalinks / slugs

This is the first site I have had a problem with the page name not showing up in the domain page name. Like https://imaginedesigns.ca/?page_id=11 is the permalink that shows but my slug shows ‘about’ and my page name is ‘about’. Nothing I do can get the address to change to https://imaginedesigns.ca/about Any advice pleaseenter image…

Can hook_preprocess_block() be used to alter block content in Drupal 8?

I’m finding I can’t alter block content with hook_preprocess_block() in Drupal 8. Should I expect to be able to alter content, such as a block body, using hook_preprocess_block()? For example, this has no effect on my block output: function mysite_preprocess_block(&$variables) { $variables[‘elements’][‘content’][‘body’][0][‘#text’] = ‘alter all block bodies everywhere’; }

AJAX in Magento2 (JS)

Я реалізував додавання інформації форми до бази даних за допомогою AJAX. Як мені вивести цю є інформацію на цій ж сторінці за допомогою AJAX(я реалізував її, але без AJAX) <script> require([‘jquery’],function($){ $(‘#submit_data’).on(‘click’, function (){ var nickName = $(“input[name=’nickname’]”).val(); var textReview = $(“input[name=’textreview’]”).val(); var Result = $(“input[name=’result’]”).val(); var url = “<?php echo $block->getUrl(‘reviews/index/save’) ?>”; jQuery.ajax({ url:…