Releases: sitegeist/Sitegeist.Kaleidoscope
Generic alt and title for Image Sources, no src in source tags, phpstan and no more Neos 4.3 support
Changes;
-
While the source tag allows an src attribute it is ignored in picture tags. Since this is all Kaleidoscope cares about we can remove this safely.
-
The codebase is now tested with phpstan. To do so we had to drop the Neos 4.3 support.
-
All imageSource FusionObjects now support the fusion attributes 'alt' and 'title' that will be used as fallback for the
respective attributes of the img-tag. That way it is no longer necessary to pass three separate properties around.
Examples:
- Use title and alternativeText from node properties with fallback to the asset title:
imageSource = Sitegeist.Kaleidoscope:AssetImageSource {
asset = ${q(node).property('image')}
title = ${q(node).property('title') || q(node).property('image').title}
alt = ${q(node).property('alternativeText')}
}
- Set alt and title for dummy image source
imageSource = Sitegeist.Kaleidoscope:DummyImageSource {
alt = 'Alternate assigned to source'
title = 'Title assigned to source'
}
Fix dummyimages in Neos 7.1 and correct documentation
Fix bug in sizes handling for picture sources
Thanks to @akappler for reporting and fixing.
Add Neos 7 compatibility and render empty alt-attributes by default.
Merge branch '5.0' # Conflicts: # Resources/Private/Fusion/Prototypes/Picture.fusion
Render empty alt-attributes by default
v5.1.2 Merge pull request #31 from sitegeist/bugfix/emptyAltAtttributesByDef…
Support for `renderDimensionAttributes`, `width`, `height`, `loading` and `format` resp. `formats`
Kaleidoscope will now render width
and height
attributes whenever possible by default and thus help to prevent content reflow when images are loaded. This can be controlled via renderDimensionAttributes
. Additionally the loading
attribute can be used and width
, height
and format
can be defined on the prototypes directly.
Sitegeist.Kaleidoscope:Image:
renderDimensionAttributes
: render dimension attributes (width/height) when the data is available from the imageSource. Enabled by defaultloading
: (optional) loading attribute for the img tagwidth
: (optional) the base width, will be applied to theimageSource
height
: (optional) the base height, will be applied to theimageSource
format
: (optional) the image-format likewebp
orpng
, is applied to theimageSource
Sitegeist.Kaleidoscope:Picture:
renderDimensionAttributes
: render dimension attributes (width/height) for the img-tag when the data is available from the imageSource
if not specified dimensions will be enabled automatically for pictures that only use theformats
options.formats
: (optional) image formats that will be rendered as sources of separate type (string or array)loading
: (optional) loading attribute for the img tagwidth
: (optional) the base width, will be applied to theimageSource
height
: (optional) the base height, will be applied to theimageSource
Sitegeist.Kaleidoscope:Source:
format
: (optional) the image-format for the source likewebp
orpng
, is applied toimageSource
andtype
width
: (optional) the base width, will be applied to theimageSource
height
: (optional) the base height, will be applied to theimageSource
In addition all Sitegeist.Kaleidoscope:Source rendered inside of a Sitegeist.Kaleidoscope:Picture
will inherit the values imageSource
, srcset
, sizes
, width
and height
.
Fix a bug in ResourceImageSource
Merge pull request #23 from jonnitto/bugfix/resource_image_source BUGFIX: Fix broken ResourceImageSource
Variant Preset and Neos 4.3 + 5 Support
Provides a new property variantPreset in the AssetImageSource and
DummyImageSource Fusion prototypes. The expect a string giving the
preset identifier and preset variant name separated by ::, like:
Acme.Com:Component.Teaser.Hero::landscape
In addition this adds a new method useVariantPreset() to the
ImageSourceHelperInterface that can be used to specify a variant to
use based on a configured asset variant preset:
useVariantPreset('Acme.Com:Component.Teaser.Hero', 'landscape')
That variant (if existing) of an asset will be used as base before any
further adjustments are applied.
Additionally the Sitegeist.Kaleidoscope:Picture now accepts to pass
afx content
VariantPreset Support
Provides a new property variantPreset
in the AssetImageSource
and
DummyImageSource
Fusion prototypes. The expect a string giving the
preset identifier and preset variant name separated by ::
, like:
Acme.Com:Component.Teaser.Hero::landscape
In addition this adds a new method useVariantPreset()
to the
ImageSourceHelperInterface
that can be used to specify a variant to
use based on a configured asset variant preset:
useVariantPreset('Acme.Com:Component.Teaser.Hero', 'landscape')
That variant (if existing) of an asset will be used as base before any
further adjustments are applied.
Furthermore this changes the API for using thumbnail presets:
- renames
applyPreset()
toapplyThumbnailPreset()
in
ImageSourceHelperInterface
- renames
preset
tothumbnailPreset
in Fusion prototypes
The key preset
in Fusion is still used if thumbnailPreset
is not
given to provide b/c.
Resolves #12
Neos 5 / Flow 6 compatibility
Merge branch 'feature/flow6-compatibility' # Conflicts: # Classes/Controller/DummyImageController.php # composer.json