Skip to content

Instantly share code, notes, and snippets.

@revsbech
Created June 30, 2014 08:01
Show Gist options
  • Save revsbech/8a9f11b970796017ed54 to your computer and use it in GitHub Desktop.
Save revsbech/8a9f11b970796017ed54 to your computer and use it in GitHub Desktop.
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