bigfork/htmleditorsrcset
Simple srcset integration with SilverStripe’s HTMLEditorField
Maintainers
Package info
github.com/bigfork/htmleditorsrcset
Type:silverstripe-vendormodule
pkg:composer/bigfork/htmleditorsrcset
Requires
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
BSD-3-Clause 9f0ca9e7b0bd461c7091638f390a9c7c92d4b64e
- Loz Calver <lozcalver.woop@bigfork.co.uk>
imagesresponsivesilverstripehtmleditorfieldhtmleditorretinasrcset
README
Simple srcset integration with SilverStripe’s HTMLEditorField.
What it does
Adds a srcset attribute for the provided pixel densities to every image inserted through TinyMCE. Resulting in an image tag like:
<img width="100" height="50" src="assets/530dffc7f9/image__ResizedImageWzE5OCwxMzJd.jpg" srcset="assets/530dffc7f9/image__ResizedImageWzE5OCwxMzJd.jpg 1x, assets/530dffc7f9/image__ResizedImageWzM5NiwyNjRd.jpg 2x" />
What it doesn’t do
This module doesn’t add a sizes attribute, nor does it specify widths in srcset - only pixel densities.
Specifying your own pixel densities
The module will add sources for 1x and 2x pixel densities by default. You can set your own pixel densities by setting the following in your config.yml:
Bigfork\HTMLEditorSrcset\ImageShortcodeHandler: pixel_densities: [1, 2, 3]
