首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >xtype = html5smartimage

xtype = html5smartimage
EN

Stack Overflow用户
提问于 2018-03-22 14:50:42
回答 1查看 226关注 0票数 0

我在aem对话框中使用了html5smartimage。下面是我在dialog.xml中添加的代码。

代码语言:javascript
运行
复制
<image
jcr:primaryType="cq:Widget"
xtype="html5smartimage"
name="./imgFile"
fieldLabel="Image"
style="border: 2px dashed #ccc;"
height="200"
ddGroups="[media]"
fieldDescription="To use a customized icon please upload it to the dam and add it here."
allowUpload="{Boolean}false"
requestSuffix=".img.png"
renditionSuffix="/_jcr_content/renditions/original"
cropParameter="./imageCrop"
fileNameParameter="./fileName"
fileReferenceParameter="./fileReference"
rotateParameter="./imageRotate" />

我在组件中添加了这些代码行,但仍然得到“没有数据”。我可以很好地拖放图像,但阅读它似乎是唯一的问题

代码语言:javascript
运行
复制
<sly data-sty-test.imgFileObj="${properties.imgFile}"></sly>

<div data-sly-test="${!imgFileObj}">
theres no data
</div>
<div data-sly-test="${imgFileObj}">
theres is data
</div>

我到处都找过了,但一无所获。因此,在这方面的任何帮助都将不胜感激。此外,最终目标是获得图像的url。

EN

回答 1

Stack Overflow用户

发布于 2018-03-22 18:13:21

html5smartimage不会通过"name“属性保存数据。它支持许多设置,因此根据映像的配置方式,您可以期望以不同的方式保存数据。

如果将图像拖放到小部件中,则会使用与"fileReferenceParameter“关联的属性名称保存该图像。在您的例子中,它应该是data-sty-test.imgFileObj="${properties.fileReference}

如果上传了图像,则会使用fileNameParameter.中提供的名称创建一个子节点

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49422270

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档