[Flow] TYPO3.Imagine in TYPO3 Flow

Aske Ertmann aske at moc.net
Thu Feb 12 14:03:42 CET 2015


Hi again

The view helper doesn’t support resources directly, but only media assets :/

It would make sense if it supported a resource argument, however that’s not the case currently.

You can however create your own image view helper that accepts that pretty easily. Depending on what version of Flow you’re using 2.3 o 3.0, you either use the \TYPO3\Media\Domain\Service\ImageService (2.3) or the \TYPO3\Media\Domain\Service\ThumbnailService (3.0) to create the cropped image.

There are probably other who have already done this, maybe ask on IRC in #typo3-flow or on Slack in #typo3-flow?

Cheers,
Aske

> On 12 Feb 2015, at 12:40, Patric Eckhart <mail at patriceckhart.com> wrote:
> 
> Okay thank you.
> I have installed TYPO3.Media and add the viewhelper and following line:
> {namespace media=TYPO3\Media\ViewHelpers}
> <media:image asset="{f:uri.resource(resource: article.image)}" alt="Test" maximumWidth="200" maximumHeight="300" />
> 
> but i got this error:
> Catchable Fatal Error: Argument 1 passed to TYPO3\Media\ViewHelpers\ImageViewHelper_Original::render() must be an instance of TYPO3\Media\Domain\Model\AssetInterface, string given in .....
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow



More information about the Flow mailing list