I updated a Neos project from 3.3
to 4.0
and now my Root.fusion
file seems to be ignored: The website is among other things rendered without referencing CSS and JS files. Is this a common problem? What has to be adjusted?
Deleting the content of the Root.fusion
file does not change the way the page is rendered.
As mentioned on https://neos.readthedocs.io/en/4.0/CreatingASite/Fusion/InsideFusion.html#fusion-files I just changed the type
in the Site Package’s composer.json
file from typo3-flow-site
to neos-site
. This did not solve my problem.
Using Neos.Neos.fusion.autoInclude
also did not solve my problem.
sebobo
(Sebastian Helzle)
May 20, 2020, 3:48pm
#2
You don‘t need to set autoInclude for site packages. Did you rerun composer install or update after making those changes?
Are you sure it‘s not related to the NodeType name based rendering change in 4.x?
Yes, I ran composer update
.
Will have to check the change you mentioned.
Okay, the Root.fusion
file is NOT ignored:
Putting root = "Hello World!"
in this file leads to the output of Hello World!
.
sebobo
(Sebastian Helzle)
May 20, 2020, 10:10pm
#5
Yes I assume there is a Fusion prototype with the same name as your nodetype and that one is then rendered instead of what your assigned to „page“.
The upgrade instructions mention that and you can check the chapter on https://docs.neos.io/cms/manual/rendering/rendering-a-page#prototype-based-rendering
I solved my problem. This is what I did (not sure if everything was related to my problem):
ran ./flow flow:core:migrate
on my Sit Package (I initially “forgot” about that)
set neos-site
as type
in composer.json
file
Used prototype(Neos.NodeTypes:Page) {...
instead of default = Page {...
(in combination with the layout
property) to define my default page type
Thank you for your help!
1 Like
Now almost every page was displayed correctly again.
On some pages I now got this error message:
No Fusion object found in path "page" Please make sure to define one in your Fusion configuration.
The affected pages had one thing in common: [1] their node type configuration looks like this…
'Foo.Bar:BazType':
superTypes:
'Neos.NodeTypes:Page': true
...
…and [2] no Fusion prototype was defined for it.
I added code like this to the Root.fusion file for each these node types which solved the mentioned error message problem:
prototype(Foo.Bar:Baz) < prototype(Neos.NodeTypes:Page)
Is this now necessary for Neos 4.0? Was this not necessary before?
sebobo
(Sebastian Helzle)
May 22, 2020, 8:39am
#8
Since 4 it will first look for a Fusion Prototype with the same name. And if none is found it tries to evaluate “page”. Before it did just the later.
1 Like