Skip to content

Commit

Permalink
Fix regression with template custom parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Damien VERNER committed Oct 1, 2024
1 parent dbf27c6 commit 1274bd5
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Services/Twig/FetchExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,22 @@ public function renderChildren(
$firstKey = key($children);

// Define specific parameters
$currParameters = $parameters;
$currParameters['params'] = $parameters;
$currParameters['params']['col'] = count($children);
$parameters['col'] = count($children);

foreach ($children as $index => $child) {
$currParameters['params']['isFirst'] = $index === $firstKey;
$currParameters['params']['isLast'] = $index === $lastKey;
$currParameters['params']['index'] = $index;
$parameters['isFirst'] = $index === $firstKey;
$parameters['isLast'] = $index === $lastKey;
$parameters['index'] = $index;

try {
$content = $child->getContent();
$currParameters['location'] = $child;
$currParameters['viewType'] = $viewType;
$currParameters['layout'] = false;
$parameters['location'] = $child;
$parameters['viewType'] = $viewType;
$parameters['layout'] = false;
$contentRender = $this->viewManager->renderContent(
$content,
$viewType,
$currParameters
$parameters
);
$render .= $contentRender;
} catch (Exception $exception) {
Expand Down

0 comments on commit 1274bd5

Please sign in to comment.