2017 © Pedro Peláez
 

library ezresponsiveimagesbundle

Novactive eZ Responsive Images is a lightweight eZ Publish 5.x|6.x bundle for Responsive Images management.

image

novactive/ezresponsiveimagesbundle

Novactive eZ Responsive Images is a lightweight eZ Publish 5.x|6.x bundle for Responsive Images management.

  • Sunday, January 8, 2017
  • by NovaDT
  • Repository
  • 4 Watchers
  • 5 Stars
  • 274 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

Novactive eZ Responsive Images Bundle


This repository is what we call a "subtree split": a read-only copy of one directory of the main repository. It is used by Composer to allow developers to depend on specific bundles., (*1)

If you want to report or contribute, you should instead open your issue on the main repository: https://github.com/Novactive/Nova-eZPlatform-Bundles, (*2)

Documentation is available in this repository via .md files but also packaged here: https://novactive.github.io/Nova-eZPlatform-Bundles/master/ResponsiveImagesBundle/README.md.html, (*3)


Downloads Latest version License, (*4)

Novactive eZ Responsive Images is a lightweight eZ Publish 5.x|6.x bundle for Responsive Images management., (*5)

Install

Usage and main feature

Add the lib to your composer.json, run composer require novactive/ezresponsiveimagesbundle to refresh dependencies., (*6)

By default this bundle will use picturefill to load the good version of the your variations., (*7)

You can also decide to lazy load the images, in this case the bundle uses unveil.js to load the good version of the variation alias name., (*8)

Today it handles 3 versions:, (*9)

  • Mobile: viewport width < 640px
  • Desktop: default choice
  • Retina: devicePixelRatio > 1,

Then it is really interesting to understand that only the good version will be loaded in the browser. The Lazy loading is based on the view port too, if an image is not visible on the screen it will be pre-loaded and loaded on the scroll action., (*10)

It means:, (*11)

  • it reduces drastically the size and the load time of the page by not loading the non visible images
  • when an image is loaded, it ensures that is the adapted one.
        {{ ez_render_field(content, 'image', {
            parameters: {
                alias: 'blog_post_line_home',
                class: 'img-responsive img-rounded',
                unveiled: true,
            }
        }) }}

Unveiled means "Lazy Loading", (*12)

Read below, you will need 2 more aliases for each current alias that you have., (*13)

Use Composer

Add the lib to your composer.json, run composer require novactive/ezprotectedcontentbundle to refresh dependencies., (*14)

Then inject the bundle in the bundles.php of your application., (*15)

    Novactive\Bundle\eZResponsiveImagesBundle\NovaeZResponsiveImagesBundle::class => [ 'all'=> true ],

Create the _mobile and _retina Alias Names

The bundle requires that you create 2 more alias for each alias you are using. Ex:, (*16)

    gallery_full_thumbnail:
        reference: ~
        filters:
            - { name: geometry/scaledownonly, params: [354, 224] }

    gallery_full_thumbnail_mobile:
        reference: gallery_full_thumbnail
        filters:
            - { name: geometry/scalewidthdownonly, params: [175] }

    gallery_full_thumbnail_retina:
        reference: ~
        filters:
            - { name: geometry/scaledownonly, params: [708, 448] }

Load the resources in your pagelayout

    <head>
        ...
        {% include 'NovaeZResponsiveImagesBundle::novaezresponsiveimages.html.twig' %}
    </head>

The Versions

08/01 2017

dev-master

9999999-dev https://github.com/Novactive/NovaeZResponsiveImagesBundle

Novactive eZ Responsive Images is a lightweight eZ Publish 5.x|6.x bundle for Responsive Images management.

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

ezpublish ezplatform ezstudio novactive