diff --git a/lib/zin/core/directive.class.php b/lib/zin/core/directive.class.php index de539a63cf..b34242f920 100644 --- a/lib/zin/core/directive.class.php +++ b/lib/zin/core/directive.class.php @@ -98,7 +98,7 @@ class directive implements iDirective { foreach($data as $blockName => $blockChildren) { - $node->add($blockChildren, $blockName); + $node->addToBlock($blockName, $blockChildren); } } } diff --git a/lib/zin/core/node.class.php b/lib/zin/core/node.class.php index 81989a97b3..32b156c8c1 100644 --- a/lib/zin/core/node.class.php +++ b/lib/zin/core/node.class.php @@ -291,6 +291,12 @@ class node implements \JsonSerializable if($child instanceof node) $child->parent = $this; + if($child instanceof node) + { + if(isset($child->parent)) skipRenderInGlobal($child); + $child->parent = $this; + } + if($name === 'children' && $child instanceof node) { $blockName = static::getNameFromBlockMap($child->fullType()); diff --git a/lib/zin/core/zin.func.php b/lib/zin/core/zin.func.php index 1c060f5b67..a8ebb9cbc0 100644 --- a/lib/zin/core/zin.func.php +++ b/lib/zin/core/zin.func.php @@ -39,8 +39,8 @@ require_once __DIR__ . DS . 'jquery.class.php'; */ function to(string $blockName, mixed ...$args): directive { - $node = new node(...$args); - return directive('block', array($blockName => $node)); + skipRenderInGlobal($args); + return directive('block', array($blockName => $args)); } /**