#106157ce:link.clickEnlarge Harmonize cropVariant with clickenlarge
Description
When cropVariants are used, the click-enlarged image differs from the version shown on the website. This behaviour could be a little bit confusing for website visitors. If the ce:link.clickEnlarge viewhelper would be expanded by cropVariants, the output will be the same for both images.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
History 3
-
Benni Mack commented and changed status
NewNeeds Feedback removed the assignee <span data-processor="relativetime" data-value="2025-03-23T13:23:30+00:00" > 03/23/25, 13:23 </span> -
wini2 no-lastname-given commented <span data-processor="relativetime" data-value="2025-03-27T18:21:28+00:00" > 03/27/25, 18:21 </span>
Thank you for your interest.
It’s a discrepancy between what a user gets and probably expects. Otherwise the image could be linked to another ressource (maybe to a completely other image). Showing the same image in normal and enlarged view, would be more stringent. A use-case might be an image with a specific detail which gets overlooked on enlarged view of a much bigger enlarged depiction (maybe a tiny peace of text or a date). Say you have a small cropvariant for mobile which shows that date or a tiny text-detail, only readable if enlarged. If a huge picture is shown when enlarged, its not likely that that detail gets recognized.
By the way: The t3sbootstrap-Extension has implemented this bevhavior and the additional possibility for the editor to decide if the cropvariant or the whole imagae should be shown when zoomed (https://github.com/t3solution/t3sbootstrap/blob/master/Resources/Private/Partials/Content/Media/Type/Image.html). But I think you can agree that it would be much easier if the viewhelper would support such an option.
-
Georg Ringer commented and changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2026-10-07T18:50:28+00:00" > 10/07/26, 18:50 </span>this can already be solved without any core change.
ce:link.clickEnlargepasses itsconfigurationargument unchanged toContentObjectRenderer::imageLinkWrap(), which supports the optioncropVariant. If it is set, the crop area of that variant is written into the signedtx_cms_showpicURL, so the enlarged image is cropped accordingly.In the default partial of Fluid Styled Content the configuration comes from
settings.media.popup, i.e. via TypoScript:styles.content.textmedia.settings.media.popup.cropVariant = desktop
(or the settings path of the setup you use, e.g.
lib.contentElement.settings.media.popup.cropVariant). Without it, the variantdefaultis used, if the editor has created one with that name.Limitation: the variant applies to all images of the element; it cannot be chosen per image or per editor. A “enlarge cropped image” checkbox would need new TCA and database schema and belongs in an extension (as t3sbootstrap does). A
cropVariantargument on the ViewHelper would only be a convenience for Fluid templates.
Hey wini,
I have to disagree. I have multiple cropvariants based on the browser’s viewport / width etc. For me, click enlarge should get me the full image, no matter what I see due to my mobile window.
Our current behavior is the same as on wikipedia btw.