Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

{{picture::*}}-Inserttag not using width and height parameter #475

Open
ghost opened this issue Nov 22, 2017 · 1 comment
Open

{{picture::*}}-Inserttag not using width and height parameter #475

ghost opened this issue Nov 22, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Nov 22, 2017

Issue by @UB3RL33T
November 21st, 2017, 12:35 GMT

Using the Picture-Tag I have noticed that, even if there are width and height parameters passed, the image will be displayed with it's natural width and height.

{{picture::[imageOrUuid]?width=800&height=400&alt=sometext}}

Will ignore the passed width and height and use the images natural size.

Upon further investigation I have found that in
https://github.com/contao/core/blob/3e41ad8718f6dea9c10c8a9b0341ed86f2bbe2ae/system/modules/core/library/Contao/InsertTags.php#L1040
The Picture::create is being called with 0-values as $width and $height.
This seems to be a bug as the documentation states, that width and height parameters can be passed to {{picture::*}}.

@ghost
Copy link
Author

ghost commented Nov 22, 2017

Comment by @ausi
November 21st, 2017, 21:47 GMT

The documentation is actually wrong. The {{picture::*}} insert tag only supports size, alt, class, rel, and template, see contao/core#7635.

{{picture::*}} is meant for responsive images, which needs a size ID instead of width/height. If you want to pass width and height you should use the {{image::*}} insert tag.

This should get fixed in the documentation.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants