adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
733 stars 740 forks source link

[Teaser] Allow to choose the image delegate component via template policy #1085

Open karlklin opened 4 years ago

karlklin commented 4 years ago

I would like to switch on/off inline cropping and rotation using policy mechanism for Teaser component. Since Teaser delegates rendering to Image component we tried to achieve this by setting appropriate policy for Image component within the same Layout container.

Current behavior/steps to reproduce

  1. Go to template: http://localhost:4502/editor.html/conf/wknd/settings/wcm/templates/landing-page-template/structure.html

  2. Modify WKND Image - Carousel for Image component for first occurrence of Layout container on the template and switch off inline cropping along with rotation: Properties -> Features and then Orientation->Rotate along with Cropping->Allow Crop options)

  3. Go to following page http://localhost:4502/editor.html/content/wknd/language-masters/en/adventures.html

  4. Add Teaser component to first occurrence of Layout container

  5. Use inline editing for the Teaser component

  6. Option for inline cropping and rotation is still available

Expected behavior/code Option for inline cropping and rotation should not be available

Environment

Possible Solution We've managed to sort out the issue by adding Features node from Image component's _cq_design_dialog. Is it recommended solution to resolve this issue?

ky940819 commented 4 years ago

My 2c on this is that there should be a single image design dialog that is reused by all image components and preferably a unified presentation logic as well.

It's not just image editing features that are missing from the teaser, it's everything about the image (lazy loading, widths, quality, etc).

It would probably be a new version of the teaser, but if the design dialog allowed the template author to specify what component should be used for an image (and default to the CC image component) then the teasers image could be handled with all features of the Image component and would also be extensible.

This would definitely be a breaking change though.

Just a thought.