Download the PHP package dorsetdigital/silverstripe-element-imagetext without Composer
On this page you can find all versions of the php package dorsetdigital/silverstripe-element-imagetext. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dorsetdigital/silverstripe-element-imagetext
More information about dorsetdigital/silverstripe-element-imagetext
Files in dorsetdigital/silverstripe-element-imagetext
Package silverstripe-element-imagetext
Short Description Adds an Elemental content block with text and an image
License BSD-3-Clause
Homepage https://github.com/DorsetDigital/silverstripe-element-imagetext
Informations about the package silverstripe-element-imagetext
Silverstripe Element Image/Text
Adds an Elemental content block containing rich text and an accompanying image.
Requirements
- PHP ^8.3
- Silverstripe CMS ^6.0
- DNADesign Silverstripe Elemental ^6.0
- Silverstripe LinkField ^5.0
For Silverstripe CMS 4 projects, use the 1.x releases.
Installation
Install with Composer:
Then run a dev/build.
Usage
The module adds an Image & Text Elemental block with:
- rich-text content
- a single image
- configurable image position and relative width
- image alt text
- an optional LinkField link, including internal, external, email and telephone links
Images are rendered responsively as WebP derivatives, with intrinsic dimensions and native lazy loading.
The module intentionally provides no frontend CSS. The generated markup uses content-element__* classes so projects can apply their own layout and styling.
Image widths
The values offered by the image-width dropdown can be changed through Silverstripe configuration. The configured key is output as a CSS class and the value is the CMS label:
See the SCSS example for one possible implementation.
Upgrading from 1.x
Version 2 targets Silverstripe CMS 6 and PHP 8.3 or newer and contains deliberate breaking data-model changes.
Before upgrading, take a database backup.
The Image relation has changed from many_many to has_one, reflecting the fact that the element supports a single image. The old SiteTree-only ImageLink relation has also been replaced by Silverstripe LinkField.
After updating the code, run a dev/build and then run the supplied migration task before editing existing Image & Text elements:
The task copies the first image from the legacy many-many relation into the new single-image relation and converts legacy SiteTree image links into LinkField SiteTreeLink records. It is safe to run more than once: already-migrated values are skipped, and existing v2 values are not overwritten.
The migration is intentionally explicit rather than automatic. Review the migrated content before removing any legacy database tables or columns.
All versions of silverstripe-element-imagetext with dependencies
silverstripe/cms Version ^6.0
silverstripe/linkfield Version ^5.0
dnadesign/silverstripe-elemental Version ^6.0