Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

img attributes to facilitate the use of Responsive Images & Media Libraries #524

Merged
merged 5 commits into from
Jan 6, 2025

Conversation

aSeriousDeveloper
Copy link
Contributor

@aSeriousDeveloper aSeriousDeveloper commented Dec 19, 2024

For #249
Recreation of #489

  • src / size are for responsive image support a la Spatie Media Library
  • data-media-id is for storing / parsing IDs used by a Media Library of any sort

The reason I recreated this was due to inactivity on the other PR, and to split the media item changes into a PR separate from adding a new iFrame node.

The iFrame node would still be beneficial, in my opinion, but I'll let @rubenlopezgea-at-coodex manage that.

- src / size are for responsive image support a la Spatie Media Library
- data-media-id is for storing / parsing IDs used by a Media Library of any sort
@aSeriousDeveloper aSeriousDeveloper changed the title Support Additional Attributes on Image / Media Node img attributes to facilitate the use of Responsive Images & Media Libraries Dec 19, 2024
@awcodes
Copy link
Owner

awcodes commented Dec 28, 2024

Where would the srcset and sizes be defined?

@aSeriousDeveloper
Copy link
Contributor Author

Where would the srcset and sizes be defined?

These would be provided by the MediaAction and EditMediaAction, however I didn't add these to the core versions of these actions as I felt putting these attributes into the defaults of these actions would be out of scope / confusing for people using them, instead allowing them to be exposed by other packages that may provide these in other ways.

The most notable example being Spatie's media library which generates responsive images, as well as any packages which extend its functionality like Ralph J Smit's Media Library Manager.

I can look at modify this PR to have the default actions potentially provide an option to fill in the srcset and sizes attributes, although I'm not sure how that implementation would look. Probably inputting as key/values, parsing that as a string, then doing the reverse for edit?

@awcodes
Copy link
Owner

awcodes commented Dec 30, 2024

I'm ok with them not being default. Prefer it that way. Should the Readme cover the usage though?

Also need to make sure it's doesn't break anything with Curator.

@aSeriousDeveloper
Copy link
Contributor Author

I can update the readme to mention the new attributes.

@aSeriousDeveloper
Copy link
Contributor Author

Readme updated to give a quick explanation of the new attributes.

@awcodes awcodes merged commit 908f481 into awcodes:3.x Jan 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants