[SOLVED] ResourceViewHelper: exception but resource is available


i have a problem with the resource ViewHelper to generates a image URI. I got the following exception:

An exception was thrown while Neos tried to render your page
The ResourceViewHelper did neither contain a valuable "resource" nor "path" argument.

What i did


Debug in ImmolistItem.html <f:debug>{element.properties}</f:debug> :

Now I used the code from documentation (http://flowframework.readthedocs.io/en/stable/TheDefinitiveGuide/PartIII/ResourceManagement.html#id4) but for me <img src="{f:uri.resource(resource: element.properties.previewImage.originalResource)}" /> isnt working.

Why is this exception thrown? The resource is there?

From what I can read from the Asset object the resource is accessible at resource and not originalResource. So try

<img src="{f:uri.resource(resource: element.properties.previewImage.originalResource)}" />

Or maybe the image viewhelper from <neos.media:image image="{element.properties.previewImage}" /> (I can’t remember if that’s the right syntax, but look in the viewhelper file for all the attributes

1 Like

Thank you for your answer! The neos.media viewhelper is working :slight_smile:

Its still strange that this works:
{neos.media:uri.image(image: element.properties.previewImage)}

and this not:
{f:uri.resource(resource: element.properties.previewImage.originalResource)}

Edit:// Ok now i got it… its like you said: not originalResource! Its resource .
i was very confused because its still originalResource in the stable documentation

1 Like