Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The media is only resized by the base css in origins. Many times the media is much too big for the screens being viewed on. The home page stream can have many images per post and all of them bigger than they need to be for handheld devices. On the full node view, the image is original size and horribly unoptimized.
Proposed resolution
Use the Picture module to load appropriate sized images for the screen size. The field entity and field instances would then need to be adjusted to have properly sized images with the ability to see larger versions if wanted.
Remaining tasks
- Apply the appropriate field entity displays to the individual content types.
- Style the elements to look more consistent.
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#4 | issue-2172677-4-responsive-media.patch | 38.34 KB | Devin Carlson |
#3 | issue-2172677-3-responsive-media.patch | 26.67 KB | Devin Carlson |
#1 | issue-2172677-responsive-media.patch | 28.55 KB | Zarabadoo |
Comments
Comment #1
Zarabadoo CreditAttribution: Zarabadoo commentedUpload the first patch to add a feature that stores image styles and breakpoint mappings for the picture module.
Comment #2
Zarabadoo CreditAttribution: Zarabadoo commentedFix the title spelling.
Comment #3
Devin Carlson CreditAttribution: Devin Carlson commentedAn updated version of #1 which moves some code around in order to make dependencies more explicit, standardizes some weights and removes the oembed file displays in favour of in-progress picture module integration with oembed formatters.
Otherwise tested #1 and didn't run into any issues.
Comment #4
Devin Carlson CreditAttribution: Devin Carlson commentedAn updated version of #3 which fixes a number of issues:
Comment #5
Devin Carlson CreditAttribution: Devin Carlson commentedTested #4 with a fresh Commons install and verified that the attached media is responsive and that images display using appropriate image styles depending on the viewport.
Committed #4 to Commons 7.x-3.x.
http://drupalcode.org/project/commons.git/commit/075e4c7