Skip to content
Snippets Groups Projects
Commit ffaf0fa6 authored by Marco Guidetti's avatar Marco Guidetti Committed by Dieuwe de Boer
Browse files

Issue #3378353: Add a Sector Release Notes Custom block to 9.5.x

parent d6d84abf
No related branches found
No related tags found
1 merge request!45Issue #3378353 "Implementing release notes block"
langcode: en
status: true
dependencies:
module:
- sector_blocks
theme:
- claro
id: sectorblockssectorreleasenotesblock
theme: claro
region: highlighted
weight: 0
provider: null
plugin: sector_release_notes
settings:
id: sector_release_notes
label: 'Sector Release Notes'
label_display: '0'
provider: sector_blocks
visibility: { }
<?php
use Symfony\Component\Yaml\Yaml;
/**
* Place the Release Notes Block
*/
function sector_blocks_update_8001() {
$message = NULL;
$config_path = drupal_get_path('module', 'sector') . '/config/install/block.block.sectorblockssectorreleasenotesblock.yml';
$data = Yaml::parseFile($config_path);
\Drupal::configFactory()->getEditable('block.block.sectorblockssectorreleasenotesblock')->setData($data)->save(TRUE);
$message = 'The Release notes block has been placed.';
return $message;
}
\ No newline at end of file
<?php
namespace Drupal\sector_blocks\Plugin\Block;
use Drupal\Core\Block\BlockBase;
/**
* Provides the Sector Release Notes Block
*
* @Block(
* id = "sector_release_notes",
* admin_label = @Translation("Sector blocks - Sector Release Notes block"),
* )
*/
class SectorReleaseNotes extends BlockBase {
/**
* {@inheritdoc}
*/
public function build() {
$current_path = \Drupal::service('path.current')->getPath();
return [
'#markup' => $this->t('<div data-drupal-messages="" class="messages-list"><div role="contentinfo" aria-labelledby="message-status-title" class="messages-list__item messages messages--status" style="position: relative;">Sector is getting Drupal 10 ready! We will release a series of updates to the Sector 9.5.x branch and additional modules to support the upgrade process. Keep up-to-date on <a href="https://www.sector.nz/news/news-and-updates-sector-9-sector-10-upgrade-path" target="_blank">News and Updates for the Sector 9 to Sector 10 upgrade path on Sector.nz</a><a href="/admin/structure/block/manage/sectorblocksreleasenotesblock/delete?destination='.$current_path.'" style="position: absolute; top: 5px; right: 15px; display: block; text-decoration:none;" >x</a> </div>
</div>'),
];
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment