Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Various Neos plugin snippets
/*
Accessing the current node or page (documentNde)
*/
/** @var \TYPO3\TYPO3CR\Domain\Model\Node $currentNode */
$currentNode = $request->getInternalArgument('__node');
/** @var \TYPO3\TYPO3CR\Domain\Model\Node $currentNode */
$currentPage = $request->getInternalArgument('__documentNode');
/*
Accessing general properties from TypoScript:
prototype(My.Package:MyPlugin) < prototype(TYPO3.Neos:Plugin)
prototype(My.Package:MyPlugin) {
package = 'My.Package'
controller = 'MyController'
action = 'index'
site = ${q(site)}
}
*/
/** @var \TYPO3\Eel\FlowQuery\FlowQuery $siteNode */
$siteNode = $request->getInternalArgument('__site');
/** @var \TYPO3\TYPO3CR\Domain\Model\Node $dailyReportsNode */
$dailyReportsNode = current($siteNode->children('daily-reports')->get());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.