-
-
Notifications
You must be signed in to change notification settings - Fork 224
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUGFIX: Adjust service templates for references
These templates are used e.g. in the reference editor, we should create a better endpoint in the UI package, but for now this will fix setting references and provides Fluid users with a viewhelper to render node labels.
- Loading branch information
Showing
3 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
namespace Neos\Neos\ViewHelpers\Node; | ||
|
||
use Neos\ContentRepository\Core\Projection\ContentGraph\Node; | ||
use Neos\Flow\Annotations as Flow; | ||
use Neos\FluidAdaptor\Core\ViewHelper\AbstractViewHelper; | ||
use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface; | ||
|
||
/** | ||
* | ||
*/ | ||
class LabelViewHelper extends AbstractViewHelper | ||
{ | ||
#[Flow\Inject()] | ||
protected NodeLabelGeneratorInterface $nodeLabelGenerator; | ||
|
||
public function initializeArguments(): void | ||
{ | ||
parent::initializeArguments(); | ||
$this->registerArgument('node', Node::class, 'Node', true); | ||
} | ||
|
||
public function render(): string | ||
{ | ||
/** @var Node $node */ | ||
$node = $this->arguments['node']; | ||
return $this->nodeLabelGenerator->getLabel($node); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters