Skip to content

Commit

Permalink
FEATURE: Add implicit ContentElementWrapping to `Neos.Fusion:Collec…
Browse files Browse the repository at this point in the history
…tion` if nodes are mapped by `Neos.Fusion:RawCollection`

This package will store a reference to the currently rendered Node in
the array-key `__node` whenever `Neos.Fusion:RawCollection` maps a Node
to an Array.

If the `Neos.Fusion:Collection` iterates and detects an array-item that
has the key `__node` `Neos.Neos:ContentElementWrapping` is applied to the
content automatically.
  • Loading branch information
mficzel committed Feb 2, 2018
0 parents commit 9281c42
Show file tree
Hide file tree
Showing 6 changed files with 936 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Classes/Fusion/GetContextImplementation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
namespace PackageFactory\AtomicFusion\Mapping\Fusion;

use Neos\Flow\Annotations as Flow;
use Neos\Fusion\FusionObjects\AbstractFusionObject;
use Neos\Utility\ObjectAccess;

/**
* Fusion object to access values from current context by name
*/
class GetContextImplementation extends AbstractFusionObject
{
/**
* @return mixed
*/
public function getProperty()
{
return $this->fusionValue('property');
}

/**
* Just return the context property
*
* @return mixed
*/
public function evaluate()
{
if ($property = $this->getProperty()) {
return ObjectAccess::getProperty( $this->runtime->getCurrentContext(), $property);
} else {
return null;
}
}
}
5 changes: 5 additions & 0 deletions Configuration/Settings.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Neos:
Neos:
fusion:
autoInclude:
PackageFactory.AtomicFusion.Mapping: true
Loading

0 comments on commit 9281c42

Please sign in to comment.