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
744 stars 752 forks source link

[Teaser] The Json export doesn't properly nest Image #349

Open godanny86 opened 6 years ago

godanny86 commented 6 years ago

Bug Report

Current Behavior If you want to use the Teaser component's JSON export in conjunction with the SPA editor (or another headless approach) the image src is not exported:

"teaser": {
"title": "Lorem Ipsum",
"description": "<p>Is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>\r\n",
"actionsEnabled": false,
"imageLinkHidden": false,
"titleLinkHidden": false,
"actions": [],
+"imagePath": "/content/wknd/en/jcr:content/root/responsivegrid/teaser",
":type": "wknd/components/content/teaser"
}

Expected behavior/code Ideally the same structure as the imageDelegate is exposed. Something like:

"teaser": {
"title": "Lorem Ipsum",
"description": "<p>Is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>\r\n",
"actionsEnabled": false,
"imageLinkHidden": false,
"titleLinkHidden": false,
"actions": [],
+  "image": {
+   "src": 
+ "/content/wknd/en/_jcr_content/root/responsivegrid/image_1364553646.coreimg.jpeg/1540567262779.jpeg",
+  "srcUriTemplate": "/content/wknd/en/_jcr_content/root/responsivegrid/image_1364553646.coreimg{.width}.jpeg/1540567262779.jpeg",
+ "areas": [],
+ "uuid": "122ca431-19c3-4608-9bc7-d2527ac009f5",
+ "lazyEnabled": false,
+ "widths": [],
+ ":type": "wknd/components/content/image"
+ }
":type": "wknd/components/content/teaser"
}

Environment

msagolj commented 6 years ago

@godanny86 Thanks for reporting the issue. Wee added it to our backlog (CQ-4256259)

godanny86 commented 6 years ago

Thanks @msagolj!

Since issue #298 is also marked as a bug maybe this should be too @vladbailescu ?

vladbailescu commented 6 years ago

@godanny86 , I marked it as an enhancement since exposing the imagePath instead of the actual image model was a decision we took at that moment. We generally mark as bugs things that don't work as designed/expected. Anyway, I think you're right and we should improve this. We would very much appreciate a contribution for this, in case you want to have a stab at it.

jckautzmann commented 3 years ago

@adobe export issue to Jira project SITES as Story

github-jira-sync-bot commented 3 years ago

:white_check_mark: Jira issue SITES-3309 is successfully created for this GitHub issue.