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 by intoeetive · Pull Request #4856 · ExpressionEngine/ExpressionEngine · GitHub
Skip to content

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

Open
intoeetive wants to merge 2 commits into
7.devfrom
feature/7.x/wrap-svg
Open

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
intoeetive wants to merge 2 commits into
7.devfrom
feature/7.x/wrap-svg

Conversation

@intoeetive

@intoeetive intoeetive commented May 21, 2025

Copy link
Copy Markdown
Contributor

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

@Yulyaswan Yulyaswan left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor Author

@Yulyaswan

Copy link
Copy Markdown
Collaborator

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.

2 participants