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
747 stars 753 forks source link

Page List displays description on Teaser items when toggled off #2763

Open HitmanInWis opened 6 months ago

HitmanInWis commented 6 months ago

Bug present as of version: 2.24.7-SNAPSHOT

When "Display as teaser" is toggled on for a page List component, the Description is shown on the teaser tile regardless of whether "Show description" is toggled on.

To fix this, something like the following logic needs to be added to com.aemgo.core.models.entities.impl.PageListItemImpl#getTeaserResource

                if (showDescription) {
                    overriddenProperties.put(Teaser.PN_DESCRIPTION_FROM_PAGE, true);
                } else {
                    hiddenProperties.add(JcrConstants.JCR_DESCRIPTION);
                    overriddenProperties.put(Teaser.PN_DESCRIPTION_FROM_PAGE, false);
                }