If the node has a content object attached, the property will be fetched
there if it is gettable.
public getProperty ( string $propertyName ) : mixed | ||
$propertyName | string | Name of the property |
return | mixed | value of the property |
/** * Render a node label * * @param AbstractNodeData $nodeData * @param boolean $crop This argument is deprecated as of Neos 1.2 and will be removed. Don't rely on this behavior and crop labels in the view. * @return string */ public function getLabel(AbstractNodeData $nodeData, $crop = true) { if ($nodeData->hasProperty('title') === true && $nodeData->getProperty('title') !== '') { $label = strip_tags($nodeData->getProperty('title')); } elseif ($nodeData->hasProperty('text') === true && $nodeData->getProperty('text') !== '') { $label = strip_tags($nodeData->getProperty('text')); } else { $label = ($nodeData->getNodeType()->getLabel() ?: $nodeData->getNodeType()->getName()) . ' (' . $nodeData->getName() . ')'; } if ($crop === false) { return $label; } $croppedLabel = trim(Functions::substr($label, 0, 30)); return $croppedLabel . (strlen($croppedLabel) < strlen($label) ? ' …' : ''); }