Skip to content

Conversation

@intoeetive
Copy link
Contributor

@intoeetive intoeetive commented May 21, 2025

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

User Guide: ExpressionEngine/ExpressionEngine-User-Guide#992

…ile field

Enabled passthrough of HTML attributes for `wrap="image"` parameter on file field
Copy link
Collaborator

@Yulyaswan Yulyaswan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few moments here

  1. {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">
Screenshot 2025-10-14 at 09 27 27
Screenshot 2025-10-14 at 09 27 51

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">

  1. {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.
Screenshot 2025-10-14 at 09 29 39
Screenshot 2025-10-14 at 09 30 19

@intoeetive intoeetive requested a review from Yulyaswan October 27, 2025 07:32
@intoeetive
Copy link
Contributor Author

@Yulyaswan the 2nd is fixed
The 1st we probably can't do anything, as we don't have width/height of SVG image server-size. Please test with a regular image, it should work

@Yulyaswan
Copy link
Collaborator

tested. Now everything works!!!
thanks, @intoeetive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants