Template broken, Neos 2.0 and ViewHelpers

Hello together!

I’ve recently updated a Neos-page from 1.2 to 2.0. Now the template ist broken. The reason seams to be that with 2.0 the class TYPO3\Neos\ViewHelpers\ContentElementViewHelper has been removed. The Docs say that the ContentElementViewHelper is no longer needed because wrapping is now done with typoscript. I am not exactly sure what I have to do now.

Within the template I used {parts.menu -> f:format.raw()} for displaying the menu, that seems to be the problem now as Neos can’t find that ViewHelper as it does not exists anymore.

What can I do to make my site work again? I searched within the old Neos 1.2 packages to find that class and copy it to the new 2.0 one but I wasn’t lucky enough to find it.

I am really thankful for all help which will be given to me.

Greetings

Erm, so do you lack the f:format.raw() VH or the ContentElementViewHelper? I’m confused…

Hey Karsten,

I am not exactly sure. The exception says that I lack the ContentElementViewHelper but in it the menu function is also mentioned so I guessed that the menu needs the ContentElementViewHelper.

Could it be that the class my menu TypoScript is extending just does not exist anymore?

Exception #1407060572 in line 568 of /var/www/clients/client0/web19/web/Neos-1.2/Data/Temporary/Production/Cache/Code/Flow_Object_Classes/TYPO3_Fluid_Core_Parser_TemplateParser.php: The ViewHelper "<neos:contentElement>" could not be resolved.
Based on your spelling, the system would load the class "TYPO3\Neos\ViewHelpers\ContentElementViewHelper", however this class does not exist.

49 TYPO3\Fluid\Core\Parser\TemplateParser_Original::initializeViewHelperAndAddItToStack(TYPO3\Fluid\Core\Parser\ParsingState, "neos", "contentElement", array|1|)
48 TYPO3\Fluid\Core\Parser\TemplateParser_Original::openingViewHelperTagHandler(TYPO3\Fluid\Core\Parser\ParsingState, "neos", "contentElement", " node="{node}"", FALSE)
47 TYPO3\Fluid\Core\Parser\TemplateParser_Original::buildObjectTree(array|41|, 2)
46 TYPO3\Fluid\Core\Parser\TemplateParser_Original::parse("{namespace neos=TYPO3\Neos\ViewHelpers}
<neos:contentElement node="{node}">
     <nav role="navigation">
         <ul id="js-navigation-menu" class="navigation-menu show">
             <f:comment><li class="nav-link"><a href="/">Startseite</a></li></f:comment>
             <f:render section="itemsList" arguments="{items: items}"/>
       </ul>
     </nav>
 </neos:contentElement>
 <f:section name="itemsList">
     <f:for each="{items}" as="item">
         <f:if condition="{item.subItems}">
             <f:then>
                 <li class="{item.state} nav-link more">
                     <neos:link.node node="{item.node}">{item.label}</neos:link.node>
                   <ul class="submenu">
                       <f:render section="itemsList" arguments="{items: item.subItems}"/>
                   </ul>
               </li>
           </f:then>
           <f:else>
               <li class="{item.state} nav-link">
                   <neos:link.node node="{item.node}">{item.label}</neos:link.node>
               </li>
           </f:else>
       </f:if>
   </f:for>
 /f:section>
")
45 TYPO3\Fluid\View\AbstractTemplateView::render()
44 TYPO3\TypoScript\TypoScriptObjects\TemplateImplementation_Original::evaluate()
43 TYPO3\TypoScript\Core\Runtime_Original::evaluateObjectOrRetrieveFromCache(TYPO3\Neos\TypoScript\MenuImplementation, "landingPage<ITsMind.FSFrey:Page>/body<TYPO3.TypoScript:Template>/parts/menu", array|16|, array|5|)
42 TYPO3\TypoScript\Core\Runtime_Original::evaluateInternal("landingPage<ITsMind.FSFrey:Page>/body<TYPO3.TypoScript:Template>/parts/menu", "NULL", NULL)
41 TYPO3\TypoScript\Core\Runtime_Original::evaluate("landingPage<ITsMind.FSFrey:Page>/body<TYPO3.TypoScript:Template>/parts/menu")
40 TYPO3\TypoScript\TypoScriptObjects\Helpers\TypoScriptPathProxy_Original::objectAccess()
39 TYPO3\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode_Original::getPropertyPath(TYPO3\Fluid\Core\ViewHelper\TemplateVariableContainer, "parts.menu", TYPO3\Fluid\Core\Rendering\RenderingContext)
38 FluidCache_Standalone_template_file_LandingPage_bcd33757fc589de41e16dfef71bb4c8ca9546a6a::{closure}()
37 TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper::renderChildren()
36 TYPO3\Fluid\ViewHelpers\Format\RawViewHelper_Original::render(NULL)
35 call_user_func_array(array|2|, array|1|)
34 TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper::callRenderMethod()
33 TYPO3\Fluid\Core\ViewHelper\AbstractViewHelper::initializeArgumentsAndRender()
32 FluidCache_Standalone_template_file_LandingPage_bcd33757fc589de41e16dfef71bb4c8ca9546a6a::section_02083f4579e08a612425c0c1a17ee47add783b94(TYPO3\Fluid\Core\Rendering\RenderingContext)
31 TYPO3\Fluid\View\AbstractTemplateView::renderSection("body", NULL, FALSE)
30 TYPO3\Fluid\View\AbstractTemplateView::renderStandaloneSection("body", NULL, FALSE)
29 TYPO3\Fluid\View\AbstractTemplateView::renderSection("body")
28 TYPO3\TypoScript\TypoScriptObjects\TemplateImplementation_Original::evaluate()
27 TYPO3\TypoScript\Core\Runtime_Original::evaluateObjectOrRetrieveFromCache(TYPO3\TypoScript\TypoScriptObjects\TemplateImplementation, "landingPage<ITsMind.FSFrey:Page>/body", array|14|, array|5|)
26 TYPO3\TypoScript\Core\Runtime_Original::evaluateInternal("landingPage<ITsMind.FSFrey:Page>/body", "NULL", TYPO3\TypoScript\TypoScriptObjects\ArrayImplementation)
25 TYPO3\TypoScript\Core\Runtime_Original::evaluate("landingPage<ITsMind.FSFrey:Page>/body", TYPO3\TypoScript\TypoScriptObjects\ArrayImplementation)
24 TYPO3\TypoScript\TypoScriptObjects\AbstractTypoScriptObject::tsValue("body")
23 TYPO3\TypoScript\TypoScriptObjects\ArrayImplementation_Original::evaluate()
22 TYPO3\TypoScript\Core\Runtime_Original::evaluateObjectOrRetrieveFromCache(TYPO3\TypoScript\TypoScriptObjects\ArrayImplementation, "landingPage", array|22|, array|5|)
21 TYPO3\TypoScript\Core\Runtime_Original::evaluateInternal("landingPage", "Exception")
20 TYPO3\TypoScript\Core\Runtime_Original::render("landingPage")
19 TYPO3\TypoScript\TypoScriptObjects\MatcherImplementation_Original::evaluate()
18 TYPO3\TypoScript\Core\Runtime_Original::evaluateObjectOrRetrieveFromCache(TYPO3\TypoScript\TypoScriptObjects\MatcherImplementation, "root<TYPO3.TypoScript:Case>/layout<TYPO3.TypoScript:Matcher>", array|5|, array|5|)
17 TYPO3\TypoScript\Core\Runtime_Original::evaluateInternal("root<TYPO3.TypoScript:Case>/layout<TYPO3.TypoScript:Matcher>", "Exception")
16 TYPO3\TypoScript\Core\Runtime_Original::render("root<TYPO3.TypoScript:Case>/layout<TYPO3.TypoScript:Matcher>")
15 TYPO3\TypoScript\TypoScriptObjects\CaseImplementation_Original::renderMatcher("layout")
14 TYPO3\TypoScript\TypoScriptObjects\CaseImplementation_Original::evaluate()
13 TYPO3\TypoScript\Core\Runtime_Original::evaluateObjectOrRetrieveFromCache(TYPO3\TypoScript\TypoScriptObjects\CaseImplementation, "root", array|15|, array|5|)
12 TYPO3\TypoScript\Core\Runtime_Original::evaluateInternal("root", "Exception")
11 TYPO3\TypoScript\Core\Runtime_Original::render("root")
10 TYPO3\Neos\View\TypoScriptView_Original::render()
9 TYPO3\Flow\Mvc\Controller\ActionController_Original::callActionMethod()
8 TYPO3\Flow\Mvc\Controller\ActionController_Original::processRequest(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)
7 TYPO3\Flow\Mvc\Dispatcher_Original::initiateDispatchLoop(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)
6 TYPO3\Flow\Mvc\Dispatcher_Original::dispatch(TYPO3\Flow\Mvc\ActionRequest, TYPO3\Flow\Http\Response)
5 TYPO3\Flow\Mvc\DispatchComponent_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)
4 TYPO3\Flow\Http\Component\ComponentChain_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)
3 TYPO3\Flow\Http\Component\ComponentChain_Original::handle(TYPO3\Flow\Http\Component\ComponentContext)
2 TYPO3\Flow\Http\RequestHandler::handleRequest()
1 TYPO3\Flow\Core\Bootstrap::run()

HTTP REQUEST:
GET / HTTP/1.1
Content-Type:
Content-Length:
Host: ;)
Connection: keep-alive
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
Dnt: 1
Accept-Encoding: gzip, deflate, sdch
Accept-Language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4



HTTP RESPONSE:
[response was empty]

PHP PROCESS:
Inode: ;)
PID: ;)
UID: ;)
GID: ;)
User: ;)

Content of the ITsMind.FsFrey > Ressurces > Private > Parts > TypoScriptObjects > Menu.html

 {namespace neos=TYPO3\Neos\ViewHelpers}
 <neos:contentElement node="{node}">
     <nav role="navigation">
         <ul id="js-navigation-menu" class="navigation-menu show">
             <f:comment><li class="nav-link"><a href="/">Startseite</a></li></f:comment>
             <f:render section="itemsList" arguments="{items: items}"/>
         </ul>
     </nav>
 </neos:contentElement>
 <f:section name="itemsList">
     <f:for each="{items}" as="item">
         <f:if condition="{item.subItems}">
             <f:then>
                 <li class="{item.state} nav-link more">
                     <neos:link.node node="{item.node}">{item.label}</neos:link.node>
                     <ul class="submenu">
                         <f:render section="itemsList" arguments="{items: item.subItems}"/>
                     </ul>
                 </li>
             </f:then>
             <f:else>
                 <li class="{item.state} nav-link">
                     <neos:link.node node="{item.node}">{item.label}</neos:link.node>
                 </li>
             </f:else>
         </f:if>
     </f:for>
 </f:section>

Try to remove the <neos:contentElement node="{node}">