[Neos] A question to the neos core team about TypoScriptView and rendering a page standalone

Aske Ertmann aske at moc.net
Thu May 30 12:00:43 CEST 2013


Hi Simon

Not sure what the best approach to this issue is. However I would probably try to tackle it like this:

If the need is to render a specific page in a module with the same output as the frontend then I would probably make a sub request to the node controller and let that handle it. Or you could try to set the view of your module to use the TypoScript view, because then you would do almost the same as the node controller and then you'd already have a controller context. Another solution could be to create your own sub request to a custom controller which has view set to TypoScriptView. And finally a solution could be to inject the controllerContext of your module to your initiated view, but I'm not sure if that will work out since the TypoScriptView doesn't extend the standalone view.

And then take into account the stuff Christian mentioned.

On 29/05/2013, at 19.26, Simon Schaufelberger (Schaufi) wrote:

> Hi neos core team,
> neos is still a baby and i don't know that baby yet very well so I'm asking the parents if they could help me ;)
> 
> either i'm thinking too complicated or it's just not possible what i'm trying to achieve. I know Robert and the rest is always interested about feedback:
> 
> I'm trying to render a full page stand alone and I don't get that working. There is no (good) API for rendering pages (yet).
> 
> Here is my current code (called in a backend module so far):
> 
> $view = $this->objectManager->get('\TYPO3\Neos\View\TypoScriptView');
> 
> $currentNode = $this->nodeService->getNodeByContextNodePath('/sites/neosdemotypo3org/features');
> 
> $typoScriptPath = 'root';
> $view->setTypoScriptPath($typoScriptPath);
> $view->assign('value', $currentNode);
> 
> and then the rest of the code from:
> \Packages\Application\TYPO3.Neos\Classes\TYPO3\Neos\View\TypoScriptView.php->render()
> 
> BUT: The I don't know how to set the controllerContext to create the $typoScriptRuntime
> 
> I tried another approach by calling the render method of my view but that also didnt work out. The menu cannot be rendered because:
> 
> Catchable Fatal Error: Argument 3 passed to TYPO3\Neos\TypoScript\MenuImplementation_Original::findParentNodeInBreadcrumbPathByLevel() must implement interface TYPO3\TYPO3CR\Domain\Model\NodeInterface, null given
> 
> Can you either modify neos to render whole pages easily or help me how to do it?
> 
> calling $view->render(); is just not working out of the box...
> -- 
> Regards, Schaufi
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos



More information about the Neos mailing list