Closed DanielRuf closed 6 years ago
Hm, seems the docs are not very clear.
<sms:image src="{resources.0.url}" treatIdAsReference="false" srcset="400, 600, 800, 1000, 1200" width="800" />
works but <sms:image image="{resources.0.url}" treatIdAsReference="false" srcset="400, 600, 800, 1000, 1200" width="800" />
doesn't and it is not directly documented what both arguments (image vs src) mean.
I can't reproduce this behavior. With ec2e38f7a0a37bfd1f4395cd870e02407ea81d3f, I added a testing page to the demo plugin with which you can test all possible combinations. Please let me know if one of those combinations doesn't work for you or if I've missed one.
To enable the testing page, you first have to enable the demo plugin, as described in the extension documentation: https://docs.typo3.org/typo3cms/extensions/sms_responsive_images/AdministratorManual/Index.html#demo-plugin
After that, you should see a new option "Testing page" in the select menu on the demo page. It will render something like this:
If the first code is equal to the second code and the third code outputs something sane (an image with 2 srcsets), everything works as expected.
Concerning the missing documentation for src vs. image, I refer to the official documentation for Fluid ViewHelpers: https://docs.typo3.org/typo3cms/ExtbaseGuide/Fluid/ViewHelper/Image.html#src
<sms:image src="{resources.0.url}" treatIdAsReference="false"
vs
<sms:image image="{resources.0.url}" treatIdAsReference="false"
The official documentation mentions that image
only accepts objects while src
accepts strings and integers. That's the way the image viewhelper behaves.
Understood.
<f:image src="{resources.0.url}" treatIdAsReference="false" />
works but not with the sms:image VH as the image parameter is registered as object.