【发布时间】:2014-05-13 03:24:53
【问题描述】:
我们正在运行 Adobe CQ,版本 5.5.0.20120220 Service Pack 2,我的任务是创建一些新模板并限制这些模板可用的组件,而无需在设计模式下手动配置它们。我已经听从了Restrict the components in AEM 5.6.1 投票最多的答案的建议。我们的设计节点下已经有了这个 .content.xml 文件,所以我只是从文件中复制了一个工作正常的现有部分,并对其进行了修改以匹配我的新模板。
我遇到的问题是,当我使用新模板创建新页面时,sidekick 是空的。我可以在 CRXDE 中看到我的配置在服务器上。当我进入设计模式时,我还可以看到已配置的组件已被选中。但副手仍然是空的。如果我取消选中一个组件并重新选中它,东西将开始出现在 Sidekick 中。我已经完成了这项工作并通过包管理器导出了设计节点,生成的文件与我从源代码管理中部署的完全匹配(空格除外)。我在这里遗漏了一些问题吗?我们以这种方式配置的其他模板很好地显示了 Sidekick 中的指定组件,所以我猜测差异在于我的模板或我的模板指定的资源类型,但我似乎无法弄清楚。提前致谢。
编辑——从 .content.xml 添加了 sn-p。整个文件有点长。如果有帮助,我可以链接到完整文件。
<?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="cq:Page">
<clientlibs/>
<jcr:content
cq:doctype="html_5"
cq:lastModified="{Date}2013-05-08T14:25:15.588-04:00"
cq:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
jcr:title="My Site"
sling:resourceType="wcm/core/components/designer">
<department-resources-main jcr:primaryType="nt:unstructured">
<par
jcr:primaryType="nt:unstructured"
sling:resourceType="foundation/components/parsys"
components="[/apps/aau-42/components/components/lms-user-media]">
</par>
</department-resources-main>
</jcr:content>
<images/>
</jcr:root>
模板数据,位于/apps/aau-42/templates/department-resources-main:
<?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:description="Template for AAU Main Department Resources Pages"
jcr:primaryType="cq:Template"
allowedParents="[/apps/aau-42/templates/department]"
jcr:title="AAU Main Department Resources Page">
<jcr:content
cq:allowedTemplates="[/apps/aau-42/templates/department_resources_detail]"
jcr:primaryType="cq:PageContent"
sling:resourceType="aau-42/components/pages/department-resources-main" />
</jcr:root>
页面组件数据,位于/apps/aau-42/components/pages/department-resources-main:
<?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"
jcr:description="Main Department Resources Page"
jcr:primaryType="cq:Component"
jcr:title="Main Department Resources Page"
sling:resourceSuperType="aau-42/components/pages/base"/>
【问题讨论】:
-
您可以发布您的 .content.xml 以供参考吗?
-
您能否再次检查页面加载时没有 JS 错误(例如通过控制台)并在新的浏览器中尝试页面(以确保驱动 Sidekick 的 JS 没有缓存)
-
哦,兄弟...我在 Chrome 隐身窗口中启动了该页面,你瞧,它奏效了。这非常令人沮丧。感谢@anotherdave 的建议。
-
@DavidHosier NP,我经常遇到这种情况 :)
标签: aem