Download the PHP package legrisch/statamic-graphql-thumbnails without Composer
On this page you can find all versions of the php package legrisch/statamic-graphql-thumbnails. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download legrisch/statamic-graphql-thumbnails
More information about legrisch/statamic-graphql-thumbnails
Files in legrisch/statamic-graphql-thumbnails
Package statamic-graphql-thumbnails
Short Description A Statamic CMS GraphQL Addon that provides a convenient thumbnail field on all asset fields.
License MIT
Informations about the package statamic-graphql-thumbnails
GraphQL Thumbnails for Statamic CMS
This Statamic GraphQL addon provides a thumbnail
field on all AssetInterface
fields. Either provide the argument name
to query by predefined formats or use Just-In-Time thumbnail generation and provide width
, height
or fit
.
Features
- Predefined thumbnail Formats: Query by
name
- Just-In-Time thumbnail: Query by
width
,height
orfit
- Control Panel UI to define formats and enable/disable JIT thumbnail generation
- Permissions for managing GraphQL thumbnail Settings
Installation
Run composer require legrisch/statamic-graphql-thumbnails
Setup
After installation, you must visit the control panel to define formats to query for or enable the JIT thumbnail generation.
Usage
Formats Usage
The thumbnail
field requires an argument name
which resolves to the name of one of your formats.
If formats are defined, you can also directly access a property srcset
on the Asset.
yields
JIT Usage
The thumbnail
field requires an argument width
or height
with an integer. Additionally you may specify the parameter fit
. The possible values are: contain
, max
, fill
, stretch
, crop
, crop_focal
with the default being crop_focal
.
yields
Full Examples
Query single thumbnail
yields
Query multiple thumbnails
Use GraphQL aliases to query multiple thumbnails:
yields
License
This project is licensed under the MIT License.