Enabled inline display of SVG files using wrap="svg" parameter on file field; Enabled passthrough of HTML attributes for wrap="image" parameter on file field#4856
Conversation
…ile field Enabled passthrough of HTML attributes for `wrap="image"` parameter on file field
Yulyaswan
left a comment
There was a problem hiding this comment.
A few moments here
{news_image wrap="image" width="width" height="height"}
This tag returns the image with its original dimensions (as stated in the documentation).
However, in practice, the width and height attributes remain empty, for example:
<img src="https://local.ee7/themes/user/site/default/asset/img/blog/backward-solid.svg" width height alt="backward-solid.svg">


This is effectively the same as using {news_image wrap="image"} without specifying any dimensions.
A more correct behavior would be to have the server detect the actual image size and populate these attributes with real values, e.g.:
<img src="https://local.ee7/themes/user/site/default/asset/img/blog/backward-solid.svg" width="880" height="880" alt="backward-solid.svg">
{news_image wrap="svg" class="my-svg" id="my-svg" style="border: 1px solid #000;" title="My SVG" alt="My SVG" width="100" height="100"}
When using the wrap="svg" option, all provided parameters are applied correctly except for width and height, which are ignored.


|
@Yulyaswan the 2nd is fixed |
|
tested. Now everything works!!! |
Enabled inline display of SVG files using
wrap="svg"parameter on file field;Enabled passthrough of HTML attributes for
wrap="image"parameter on file fieldUser Guide: ExpressionEngine/ExpressionEngine-User-Guide#992