function InstallHelper::processBannerBlock
Same name in other branches
- 9 core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::processBannerBlock()
- 8.9.x core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::processBannerBlock()
- 11.x core/profiles/demo_umami/modules/demo_umami_content/src/InstallHelper.php \Drupal\demo_umami_content\InstallHelper::processBannerBlock()
Process block_banner data into block_banner block structure.
Parameters
array $data: Data of line that was read from the file.
string $langcode: Current language code.
Return value
array Data structured as a block.
1 call to InstallHelper::processBannerBlock()
- InstallHelper::processContent in core/
profiles/ demo_umami/ modules/ demo_umami_content/ src/ InstallHelper.php - Process content into a structure that can be saved into Drupal.
File
-
core/
profiles/ demo_umami/ modules/ demo_umami_content/ src/ InstallHelper.php, line 602
Class
- InstallHelper
- Defines a helper class for importing default content.
Namespace
Drupal\demo_umami_contentCode
protected function processBannerBlock(array $data, $langcode) {
$node_url = $this->getNodePath($langcode, $data['content_type'], $data['node_id']);
$values = [
'uuid' => $data['uuid'],
'info' => $data['info'],
'type' => $data['type'],
'langcode' => 'en',
'field_title' => [
'value' => $data['field_title'],
],
'field_content_link' => [
'uri' => 'internal:/' . $langcode . '/' . $node_url,
'title' => $data['field_content_link_title'],
],
'field_summary' => [
'value' => $data['field_summary'],
],
'field_media_image' => [
'target_id' => $this->getMediaImageId($data['image_reference']),
],
];
return $values;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.