Skip to content

Commit

Permalink
Expose block names as keys of blocks array
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsafley committed Jul 18, 2024
1 parent cffb465 commit cf8db43
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/src/View/Helper/ResourcePageBlocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function getBlockCount()
/**
* Return an array of block markup for a region of the resource page.
*
* @return array
* @return array An array of block markup keyed by the block name
*/
public function getBlocksArray()
{
Expand All @@ -88,7 +88,7 @@ public function getBlocksArray()
$blocksArray = [];
foreach ($this->resourcePageBlocks[$this->resourceName][$this->regionName] as $blockName) {
$blockLayout = $this->blockLayoutManager->get($blockName);
$blocksArray[] = $blockLayout->render($view, $this->resource);
$blocksArray[$blockName] = $blockLayout->render($view, $this->resource);
}
return $blocksArray;
}
Expand Down

0 comments on commit cf8db43

Please sign in to comment.