Posted on 27/01/2026 16:18:49
You cannot.
In Swift 1, “Fill” was essentially a front-end cropping technique: the image was placed inside a fixed aspect-ratio container and CSS would crop the overflow to make it appear consistent across screen sizes.
In Swift 2, we’ve moved to server-side image handling using GetImage. Instead of faking a ratio in CSS, we request the image in the desired ratio (and crop mode) via GetImage, so the image you get back already matches the intended aspect ratio. Swift’s ImageFileViewModel/ToGetImage() flow supports this (ratio + focal point + crop mode).
Where to add the option: you don’t add “Fill” to the item type anymore. The “Fill-equivalent” is configured through the image/file selector settings (ratio) and by ensuring your template calls image.ToGetImage() with the right parameters/metadata, so GetImage outputs the correct ratio/crop.
Can you explain why you need fill? I think ther are new ways to do the same.
How Swift 2’s image ratio handling works (the new approach)
Swift 2 leans on Dynamicweb’s Image Handler (GetImage.ashx) to generate the final image that’s rendered on the page.
The flow is:
-
Editor selects an image in the file/image selector.
-
The selection can carry image metadata like:
-
Focal point (x/y) for smart cropping
-
Aspect ratio (e.g., 16/9, 1/1) via the Ratio property on ImageFileViewModel
-
Potentially a crop mode (so we can decide whether we crop to fill the ratio or just fit)
-
In templates, Swift uses ImageFileViewModel and calls image.ToGetImage(), which builds the GetImage URL and includes width/height/quality, focal point params, ratio, and crop mode when provided.
-
GetImage then returns an image that is already resized/cropped to the requested ratio, so the frontend layout stays consistent without relying on CSS overflow tricks.
Why this replaces “Fill”:
-
Swift 1 “Fill” = client-side crop illusion
-
Swift 2 = real, deterministic output image (ratio/crop decided server-side), which is more consistent across devices and avoids layout surprises.
Fill logic in Swift 1: https://github.com/dynamicweb/Swift/blob/v1.26.8/Swift/Files/Templates/Designs/Swift/Paragraph/Swift_Image.cshtml#L42
Bootstrap ratios: https://getbootstrap.com/docs/5.3/helpers/ratio/#aspect-ratios