Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing a template name to the BlockLayout view helper's render #2186

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading