aem 相关问题

Adobe Experience Manager是一个大型Web内容管理系统,目前可从Adobe Systems获得。它是以前称为Communiqué(简称:CQ)的产品的后继品牌名称。

如何在生成的 HTML5 预设输出中使用 DITA 映射的“数据”元素(AEM Guides)

我对 AEM Guides/XML 文档相当陌生,目前正在尝试弄清楚如何从生成的 AEM 站点中的 DITA 映射中获取“数据”元素。 澄清一下,DITA 映射有

回答 1 投票 0

AEM 如何翻译第二次语言副本?

我试图阐明 AEM 中的翻译流程是如何组织的。 我有一个蓝图页。第一次运行翻译作业后,我总是会得到正确翻译的语言副本。然后我...

回答 1 投票 0

使用HTL获取类数据到网页中,没有无效缓存就不会显示

我在AEM上使用htl从java类中获取一些数据并将它们放入我的html中。但问题是有一段时间页面没有更新数据。我需要等待一段时间或者我需要做无效...

回答 1 投票 0

无需 Target 集成的 AEM 个性化

我需要根据访问者之前和/或最常访问的其他网站部分(分段)来个性化我的网站主页的横幅内容。 我的网站是基础...

aem
回答 2 投票 0

从 AEM 6.5 中的 HTL 中的多字段组件检索值

我有一个遵循这种格式的多字段组件 我有一个遵循这种格式的多字段组件 <?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" jcr:primaryType="nt:unstructured" jcr:title="Awards List" sling:resourceType="cq/gui/components/authoring/dialog"> <content jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/container"> <layout jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/tabs" type="-nav"/> <items jcr:primaryType="nt:unstructured"> <awards jcr:primaryType="nt:unstructured" jcr:title="Awards Properties" sling:resourceType="granite/ui/components/foundation/section"> <layout jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns"/> <items jcr:primaryType="nt:unstructured"> <column jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/container"> <items jcr:primaryType="nt:unstructured"> <description jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/textarea" fieldLabel="Description" name="./description"/> <awards jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/multifield" composite="{Boolean}true" fieldLabel="Awards"> <field jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/container" name="./awards"> <items jcr:primaryType="nt:unstructured"> <column jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/container"> <items jcr:primaryType="nt:unstructured"> <awardtype jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/select" fieldDescription="Select Award Type" fieldLabel="Award Type" name="./type"> <items jcr:primaryType="nt:unstructured"> <gold jcr:primaryType="nt:unstructured" text="gold" value="gold"/> <silver jcr:primaryType="nt:unstructured" text="silver" value="silver"/> <bronze jcr:primaryType="nt:unstructured" text="bronze" value="bronze"/> <other jcr:primaryType="nt:unstructured" text="other" value="other"/> </items> </awardtype> <award jcr:primaryType="nt:unstructured" sling:resourceType="granite/ui/components/coral/foundation/form/textfield" fieldDescription="Name of Award" fieldLabel="Award Name" name="./award"/> </items> </column> </items> </field> </awards> </items> </column> </items> </awards> </items> </content> </jcr:root> 我试图将多字段的内容输出到列表中。 我正在尝试这样做 <ul data-sly-list="${properties.awards}"> <li>${item.type}</li> </ul> 但它不会渲染任何东西。作为测试,我做了 <ul data-sly-list="${[1,2,3,4]}"> <li>${item}</li> </ul> 这确实有效。在网上查找时,我发现了类似的资源https://helpx.adobe.com/experience-manager/using/aem65_coral_resourcetypes.html#UseaDataSourceObjecttopopulateaSelectfield 但他们似乎使用 Java 类来生成多字段,我希望这不是必需的。我不需要任何额外的逻辑,我想做的就是显示字段的值。 我做错了什么吗?使用多字段是否需要创建一个 Java 类来处理它? 编辑:我尝试通过包含内容的 js 文件来使用 javascript 对象获取内容 "use strict"; use(function () { var description = granite.resource.properties["description"]; var awards = granite.resource.properties["awards"]; return { description: description, }; }); 和使用 <div data-sly-use.awardsObject="awardslist.js"> <p> ${awardsObject.description} ${awardsObject.awards} </p> </div> 但是我无法获得奖励来退回任何东西。我尝试对奖项对象进行字符串化以查看是否获得任何数据,但我什么也没有得到。 这可能是因为您使用的是复合多字段(查看针对多字段的属性composite="{Boolean}true"),它通常将表单内容处理为复合内容,并在当前组件下创建子节点来保存属性值。 引用自文档 true 将表单内容值处理为复合值。 复合多字段支持嵌套另一个多字段(复合或 不是)。但非复合不支持嵌套。 例如,给定字段的名称属性是地址,并且 后代字段具有以下名称属性值: street1 street2 postcode city/name city/state city/country/name gps/lat gps/long 它将在存储库中保存以下结构: + addresses + item0 - street1 - street2 - postcode + city - name - state + country - name + gps - lat - long + item1 - street1 - street2 - postcode + city - name - state + country - name + gps - lat - long 由于 properties 对象仅保存当前资源的属性,因此 ${properties.awards} 将为 null,因此它不会显示任何内容。 创建 Sling 模型或 Java / Javascript 使用 API 类获取列表然后在 HTL 文件中使用它会更容易。 JS 使用 API 示例 "use strict"; use(function () { var awards = resource.getChild("awards").listChildren(); return { awards: awards, }; }); HTL 代码示例 <sly data-sly-use.children="children.js"> <ul data-sly-list.award="${children.awards}"> <li>${award.type}</li> </ul> <sly> 请注意,properties对象是ValueMap的实例,仅返回当前资源的属性。由于多字段值存储为子资源,因此您需要先访问子资源,然后再访问其属性。 返回复合多字段项目列表的动态吊索模型是理想的选择,因为它接受节点名称参数。 package com.myproject.core.models; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.Model; import javax.annotation.PostConstruct; import javax.inject.Inject; import java.util.Collections; import java.util.Iterator; @Model(adaptables = SlingHttpServletRequest.class, adapters = MultiField.class) public class MultiField { private Iterator<Resource> nodesItemList; @Inject private String multifieldNodeName; @Inject private Resource resource; @PostConstruct public void activate() { nodesItemList = Collections.emptyIterator(); Resource multiFieldNode = resource.getChild(multifieldNodeName); if (multiFieldNode != null) { nodesItemList = multiFieldNode.listChildren(); } } public Iterator<Resource> getItemsList() { return nodesItemList; } } 有关更多信息和示例,请参阅我的 Multifield Component 博客文章。

aem
回答 2 投票 0

无法使用 JcrUtils.getRepository 和 https 访问 AEM 作者

我正在尝试使用 JcrUtils 从独立的 java 应用程序访问存储库。 **repository = JcrUtils.getRepository("http://localhost:4502/crx/server");这有效** **存储库 = JcrU...

回答 2 投票 0

VWO 异步智能代码未连接进行 AB 测试

我们正在尝试使用 VWO 异步智能代码实施 AB 测试来跟踪我们网站上的表单提交。网站托管在 AEM 中,我们已将脚本(见下文)直接包含在我们的头部中...

回答 1 投票 0

将 Vue3、Typescript 与 AEM 集成

我尝试在 AEM 项目中将 Typescript 与 Vue3 集成,但没有按预期工作 当我构建时,我在终端中收到此错误 ./src/main/webpack/components/navigation/FlyoutNavigation.v 中出现错误...

回答 1 投票 0

CRXDE 不允许我上传/下载捆绑包

版本 AEM 6.3,这是我的本地实例。 每次我进入 AEM 在本地安装捆绑包时,它都会说 exec.json 丢失,我找到了解决该问题的手动覆盖方法,但它使我的时间增加了一倍

回答 2 投票 0

从AEM中的Asset对象获取所有动态媒体scene7 URL

为什么 AEM 中的 asset.listRenditions() 函数仅返回静态再现而不返回动态再现,即使我可以确认 AEM 中资产存在动态再现...

回答 1 投票 0

AEM 无法解析 Maven 项目的依赖关系

我正在尝试在本地启动并运行我们的项目。我在项目 mvn clean install -Plocal -PautoInstallPackage 的根级别运行以下命令并收到错误: 失败...

回答 1 投票 0

Adobe AEM - 环境的完整副本

我是 Adobe AEM 的新人。 所以我想克隆环境的所有内容,我知道我必须创建包,下载它,然后导入到我的本地环境中。并安装它们。 我的问题是我迷失了......

回答 1 投票 0

在代码部署时从 AEM PUBLISH 中删除 CSV 文件

我使用AEM组件创建了一个表单。 我将用户提供的详细信息保存在发布环境的 /content/dam/... 的 CSV 文件中。 虽然数据已正确获取,但是当代码...

回答 1 投票 0

AEM Multifield - 修改多字段值中的值

多字段问题 通知警报.java @Model(adaptables = {SlingHttpServletRequest.class, Resource.class},defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL) 公开课

回答 1 投票 0

AEM JCR SQL2 查询查找包含特定组件的所有页面

我希望构建一个 sql2 jcr 查询来查找 /content 下包含此组件的所有页面,例如 /apps/platform/aem-core/components/content/form/form 我读了 https://wiki.magnolia-cms.com/displa...

回答 3 投票 0

如何将AEM与React JS集成?

我需要将AEM与React JS集成,以使用react作为前端并使用AEM接收数据。 尝试遵循一些教程但没有得到解决方案还需要步骤来理解反应组件

回答 1 投票 0

如何在 AEM 上设置多个域作为调度程序上的云服务

我想在 aem 中设置多个域作为云服务,我该如何实现这一点。 我创建了两个虚拟主机和两个重写文件,但只有一个虚拟主机可以访问 有人做过吗

回答 1 投票 0

如何在AEM中创建子父组件?

如何在AEM中创建子父组件? 子父链接其中一个组件被不同的不同组件示例数据偷偷引用的其他地方使用? 我们也可以使用

aem
回答 2 投票 0

AEM 在编辑器模式下为元素添加无限高度

我们在 AEM 中创建网页时使用 HTML Banner 组件。 Banner 组件具有 height: 100vh CSS 属性来覆盖视口的整个高度。 但是在编辑模式下创作时...

回答 3 投票 0

卸载内容包呈灰色

我将包从我的作者复制到我的发布并在发布者上安装了这些包。 现在我想卸载发布者上的软件包以复制作者的新软件包......

回答 2 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.