Skip to content

Commit

Permalink
Merge pull request #2186 from omeka/pass-template-to-block-layout-render
Browse files Browse the repository at this point in the history
Allow passing a template name to the BlockLayout view helper's render
  • Loading branch information
zerocrates committed Apr 17, 2024
2 parents 340d914 + d87ec15 commit 634c2f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/src/View/Helper/BlockLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,16 +128,16 @@ public function prepareRender($layout)
* Return the HTML necessary to render the provided block.
*
* @param SitePageBlockRepresentation $block
* @param ?string $templateViewScript
* @return string
*/
public function render(SitePageBlockRepresentation $block)
public function render(SitePageBlockRepresentation $block, string $templateViewScript = null)
{
$view = $this->getView();
$blockLayout = $this->manager->get($block->layout());

// Set the configured block template, if any.
$templateName = $block->layoutDataValue('template_name');
$templateViewScript = null;
if ($templateName && $blockLayout instanceof TemplateableBlockLayoutInterface) {
// Verify that the current theme provides this template.
$config = $this->currentTheme->getConfigSpec();
Expand Down

0 comments on commit 634c2f5

Please sign in to comment.