Download the PHP package amazeelabs/silverback_cloudinary without Composer
On this page you can find all versions of the php package amazeelabs/silverback_cloudinary. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amazeelabs/silverback_cloudinary
More information about amazeelabs/silverback_cloudinary
Files in amazeelabs/silverback_cloudinary
Package silverback_cloudinary
Short Description A module that creates a graphql field to expose cloudinary image urls based on a config input.
License GPL-2.0+
Homepage https://silverback.netlify.app
Informations about the package silverback_cloudinary
Silverback Cloudinary
This module provides a graphql data producer that can be used to load (responsive) images using the Cloudinary service.
The data producer takes as parameters the original image url, and optionally the width, height, sizes and a arbitrary cloudinary transformation string and produces a json encoded string containing the html properties of the image (src, width, height, sizes, srcset).
You can use the data producer like that:
When no width is supplied, the returned data will just consist of the original image url, encoded as json
Then you can query data like this:
and the response you get should contain all the data needed for you to build the necessary tags for displaying the image.
Apart from the data producer, there is also a directive called responsiveImage which you can use directly in the graphql schema. So the above code could become:
Other parts:
- Gatsby plugin
Installation
Drupal:
composer require amazeelabs/silverback_cloudinary
- Make sure you have the CLOUDINARY_URL env variable set as instructed on the Cloudinary dashboard (testing credentials: CLOUDINARY_URL=cloudinary://219736568324247:PsDMMn1fMdm2lj9TlJMICX25KEA@ddj1ybv54)
drush en silverback_cloudinary
Gatsby:
yarn add @amazeelabs/gatsby-silverback-cloudinary
- Make sure you have the following env variables set: _CLOUDINARY_APISECRET, _CLOUDINARY_APIKEY, _CLOUDINARYCLOUDNAME
- in gatsby-config.ts , add the plugin like this (very important: after the @amazeelabs/gatsby-source-silverback plugin)