2017 © Pedro Peláez
 

typo3-cms-extension fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

image

schnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  • Tuesday, June 5, 2018
  • by schnitzler
  • Repository
  • 8 Watchers
  • 22 Stars
  • 1,242 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 16 Forks
  • 6 Open issues
  • 14 Versions
  • 54 % Grown

The README.md

TYPO3 CMS Extension "fluid_styled_responsive_images"

Build Status Codecov, (*1)

Total Downloads Latest Stable Version Latest Unstable Version License, (*2)

This project aims to provide an image-rendering process that will render responsive images with fluid, where the assumption is made, that TYPO3 CMS doesn't provide a mechanism out of the box for fluid templates while one is able to do it with TypoScript., (*3)

Installation

  • Install via composer using the current stable release and track new stable releases: composer require schnitzler/fluid-styled-responsive-images:"^10.2" and enable the extension through the extension manager / your preferred mechanism
  • Use the current development version by running composer require schnitzler/fluid-styled-responsive-images:"dev-master" in your composer.json file, run composer update
  • Clone the current development version to your typo3conf/ext directory (ex. cd typo3conf/ext && rm -Rf fluid_styled_responsive_images && git clone https://github.com/alexanderschnitzler/fluid-styled-responsive-images.git fluid_styled_responsive_images)

Configuration

The extension is configured through TypoScript, like most parts of your site are. Include the static TypoScript of the extension and then begin with the Configuration through your own TypoScript setup., (*4)

The ImageRenderer currently supports the [srcset](srcset specification) and rendering as data-attributes, which is to make custom rendering with javascript easier., (*5)

Minimal, empty configuration:, (*6)

tt_content.textmedia.settings.responsive_image_rendering {
    layoutKey = srcset

    sourceCollection {
        # Please write your own sourceCollection configuration
    }
}

Mode srcset

A sourceCollection entry is a TypoScript hash. It can contain the following indices:, (*7)

key description example
width The target size of the generated image. Supports modifications like m & c 1200c (crops the image to 1200px)
srcset a string describing the condition under which the image is displayed 1200w (1200px viewports)
dataKey a name for the generated data-attribute desktop
sizes [optional] a media query with custom styles to be applied (min-width: 1200px) 1170px

For more precise descriptions, please check out the html img element specification on srcset., (*8)

Configuration Example

tt_content.textmedia {
    settings {
        responsive_image_rendering {
            layoutKey = srcset

            sourceCollection {
                10 {
                    dataKey = desktop
                    width = 1260m
                    srcset = 1260w
                }

                20 {
                    dataKey = table
                    width = 960m
                    srcset = 960w
                }

                30 {
                    dataKey = tablet-small
                    width = 720m
                    srcset = 720w
                }

                40 {
                    dataKey = medium
                    width = 640m
                    srcset = 640w
                }

                50 {
                    dataKey = medium-phone
                    width = 360m
                    srcset = 360w
                }

                60 {
                    dataKey = small
                    width = 320m
                    srcset = 320w
                }
            }
        }
    }
}

Usage

After installation and configuration, the output of the <f:media> viewhelper uses the logic this extension supplies for images and renders the image., (*9)

Inner workings

  1. a custom image renderer is registered
  2. when the RendererRegistry is asked for a renderer suitable for the current mimetype, the renderer proposes itself if one of the known image mimetypes is matched
  3. the renderer reads the current TypoScript and merges it with global extension configuration like the enableSmallDefaultImage setting
  4. the renderer then calculates the needed sizes and returns a ready-made img-tag

Extending fluid_styled_responsive_images

Since fluid_styled_content is used, much of the output in TYPO3 CMS can be adjusted., (*10)

Example of registering custom templates and adjusting images in collaboration with the GalleryProcessor in fluid_styled_content to provide precise rendering with Bootstrap 3 based templates: websightgmbh/ws-texmedia-bootstrap., (*11)

License

GPL-2.0+, (*12)

The Versions

05/06 2018

dev-master

9999999-dev https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Alexander Schnitzler

typo3 responsive images fluid

18/09 2017

dev-TYPO3_8-7

dev-TYPO3_8-7 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

by Alexander Schnitzler

typo3 responsive images fluid

18/09 2017

8.7.1

8.7.1.0 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

by Alexander Schnitzler

typo3 responsive images fluid

06/08 2017

8.7.0

8.7.0.0 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

by Alexander Schnitzler

typo3 responsive images fluid

06/08 2017

dev-TYPO3_7-6

dev-TYPO3_7-6 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

by Alexander Schnitzler

typo3 responsive images fluid

06/08 2017

7.6.0

7.6.0.0 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

by Alexander Schnitzler

typo3 responsive images fluid

13/06 2016

dev-task/TYPO3-8-compatibility

dev-task/TYPO3-8-compatibility https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Alexander Schnitzler

typo3 responsive images fluid

13/06 2016

dev-develop

dev-develop https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Alexander Schnitzler

typo3 responsive images fluid

23/05 2016

1.2.0

1.2.0.0 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

The Development Requires

by Alexander Schnitzler

typo3 responsive images fluid

05/02 2016

1.1.1

1.1.1.0 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

by Alexander Schnitzler

typo3 responsive images fluid

05/02 2016

1.1.0

1.1.0.0 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

 

by Alexander Schnitzler

typo3 responsive images fluid

21/11 2015

1.0.2

1.0.2.0 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.5.0

 

by Alexander Schnitzler

typo3 responsive images fluid

29/10 2015

1.0.1

1.0.1.0 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.5.0

 

by Alexander Schnitzler

typo3 responsive images fluid

26/10 2015

1.0.0

1.0.0.0 https://github.com/alexanderschnitzler/fluid-styled-responsive-images

Enables creation of responsive images for fluid styled content elements.

  Sources   Download

GPL-2.0+

The Requires

  • php >=5.5.0

 

by Alexander Schnitzler

typo3 responsive images fluid