How to use native loading of Fusion files from NodeTypes folder

Hello,

according to the Release notes for Neos 8.2 native loading of Fusion files from the NodeTypes folder was added. But I couldn’t find a description on how to do this.
I tried simply putting the fusion files in the same folder as the corresponding NodeType, but that didn’t work and I get the error “The Fusion object Vcg.IwwNodeTypes:Contents.Boxen.InhaltsSchaufenster cannot be rendered”.
Can someone point me in the right direction on how to do it if I would want to?

Greetings,

Sabine

This is the pr: FEATURE: Add `nodetypes://` stream wrapper to support including fusion from NodeTypes folder by mficzel · Pull Request #3903 · neos/neos-development-collection · GitHub

The following line in the Root.fusion will load all fusion files from the NodeTypes folder of package Vendor.Site

include: nodetypes://Package.Key/**/*.fusion
1 Like

Thanks for the help!
Unfortunately it still doesn’t work, I get the errormessage:

Unable to find the stream wrapper ‘nodetypes’ while resolving the pattern: ‘nodetypes://Vcg.IwwNodeTypes/**/*.fusion’

My Root.fusion in the package Vcg.IwwNodeTypes looks like this:

include: **/*.fusion
include: nodetypes://Vcg.IwwNodeTypes/**/*.fusion

What am I missing here?

Greetings,

Sabine

That should work and looks pretty much like what Neos.Demo will do soon.

include: **/*.fusion
include: nodetypes://Neos.Demo/**/*.fusion

That should indeed work with Neos 8.2 … are you sure that all packages are upgraded.

1 Like

Hi!

We have the neos 8.2 version installed, see below:
grafik

We have a project with multiple Distribution-Packackages, could that be somehow a reason why it’s not working? (Don’t see why that would be but just to make sure)

Greetings,

Sabine

All looking good and i am happy to see some familiar sitegeist/* packages in there :slight_smile: . Lets rule out the more esoteric reasons now.

  1. Can you confirm that you see the class Neos\Neos\ResourceManagement\ NodeTypesStreamWrapper which actually implements this.

  2. Also it would be interesting which version of Fusion is running. Maybe composer installed an older version of that. That could lead to such problems.

    ./flow package:list --version | grep Neos.Fusion

2 Likes

Hello,

  1. No Neos\Neos\ResourceManagement\ NodeTypesStreamWrapper is found when I search for it in the installed packages and I also cannot see the folder ResourceManagment in Packages/Application/Neos.Neos:
    grafik
  2. The installed Version of Fusion is dev-master:
    grafik

Did I look in the wrong place?

Greetings,

Sabine

The class Neos\Neos\ResourceManagement\NodeTypesStreamWrapper should be in file Classes\ResourceManagement\NodeTypesStreamWrapper.php in the Neos.Neos package. Would expect that to be there.

The problem you have likely originates from Neos.Fusion beeing included as dev-master instead of using the 8.2 branch or a release from there The master branch is not used anymore and the development happened in the branches 8.2, 8.3 and 9.0. That is why you are getting old code.

Is it possible that you have “minimum-stability” : “dev” in your composer.json? That would explain why those dev-branches where installed. I recommend to always use “minimum-stability” : “stable” which is the default. That way you will only run code that was officially released. You can still install single packages as dev version via “@dev” in the main composer json.

I hope this helps, Martin

2 Likes

Yes, that’s it!

I added

"prefere-stable": true

to my composer.json and now have Fusion 8.2 and everything works like a charm! Thank you very much for your patient help!

Greetings,

Sabine

2 Likes