[Neos] A question to the neos core team about TypoScriptView and rendering a page standalone
Simon Schaufelberger (Schaufi)
simonschaufi at guugelmail.de
Sat Jun 1 02:43:27 CEST 2013
Hi Christian,
that example helped a lot and i now rendered my first page successfully
exept the menus. When i remove then, it works but when i add them in the
template, i get an exeption.
in particular: the breadrumb works!
whats breaking:
<ts:render path="parts.subMenu" />
and
<ts:render path="parts.mainMenu" />
something is missing here:
#1: Catchable Fatal Error: Argument 3 passed to
TYPO3\Neos\TypoScript\MenuImplementation_Original::findParentNodeInBreadcrumbPathByLevel()
must implement interface TYPO3\TYPO3CR\Domain\Model\NodeInterface, null
given, called in
[...]\Data\Temporary\Development\Cache\Code\Flow_Object_Classes\TYPO3_Neos_TypoScript_MenuImplementation.php
on line 198 and defined in
[...]\Data\Temporary\Development\Cache\Code\Flow_Object_Classes\TYPO3_Neos_TypoScript_MenuImplementation.php
line 260
but i dont know how to fix it.
well, for my newsletter i dont need any menus but just to let you know
that something is broken. here is my code: just put that in a backend
module controller action:
$view = $this->objectManager->get('\TYPO3\Neos\View\TypoScriptView'); /*
@var $view \TYPO3\Neos\View\TypoScriptView */
$currentNode =
$this->nodeService->getNodeByContextNodePath('/sites/neosdemotypo3org/features');
$typoScriptPath = 'root';
$view->setTypoScriptPath($typoScriptPath);
$view->assign('value', $currentNode);
$closestFolderNode = $currentNode;
$currentSiteNode =
$this->nodeService->getNodeByContextNodePath('/sites/neosdemotypo3org');
$typoScriptRuntime =
$this->typoScriptService->createRuntime($currentSiteNode,
$closestFolderNode, $this->controllerContext);
$typoScriptRuntime->pushContextArray(array(
'node' => $currentNode,
'request' => $this->controllerContext->getRequest(),
'site' => $currentSiteNode
));
$output = $typoScriptRuntime->render($view->getTypoScriptPath());
$typoScriptRuntime->popContext();
echo $output;
exit;
my first idea was the following code like the viewhelper:
$typoScriptPath = 'root';
$typoScriptView = new \TYPO3\TypoScript\View\TypoScriptView();
$typoScriptView->setControllerContext($this->controllerContext);
$typoScriptView->setTypoScriptPath($typoScriptPath);
$output = $typoScriptView->render();
echo $output;
exit;
but that gives me:
#1207253462: "resource://Mypackage/Private/TypoScripts/" is no directory.
my next step would be to create a special newsletter template, make that
visually available in the backend for selection and then use that
template to render that page. I guess i will need more help then.
Regards, Schaufi
More information about the Neos
mailing list