Content management system 在CQ中,如何禁用子页面属性对话框中的任何字段?
我在页面属性>基本中添加了一个新的选择类型字段“主题”。 现在,如果我在WCM中使用相同的模板添加一个新页面,那么 我选择了“主题”,这是很明显的。 是否有任何方法可以隐藏子页面中的字段Content management system 在CQ中,如何禁用子页面属性对话框中的任何字段?,content-management-system,aem,Content Management System,Aem,我在页面属性>基本中添加了一个新的选择类型字段“主题”。 现在,如果我在WCM中使用相同的模板添加一个新页面,那么 我选择了“主题”,这是很明显的。 是否有任何方法可以隐藏子页面中的字段 发生这种情况是因为我对子页面使用了相同的模板。您不能使用相同的模板,并且页面属性对话框不能不同 您可以做的是重载对话框 创建一个新模板和相应的resourceType组件 从您当前的继承 复制要与组件最低父级不同的对话框或选项卡。确保对话框是组件下的唯一节点 对对话框进行所需的更改 然后,您必须在页面jsp
发生这种情况是因为我对子页面使用了相同的模板。您不能使用相同的模板,并且页面属性对话框不能不同 您可以做的是重载对话框
- 创建一个新模板和相应的resourceType组件 从您当前的继承
- 复制要与组件最低父级不同的对话框或选项卡。确保对话框是组件下的唯一节点
- 对对话框进行所需的更改
// if the parent page is always a certain level below the root you can use
// currentPage.getAbsoluteParent(3); to get the third page down from the top
// of the current path tree.
Page parentPage = currentPage.getParent();
ValueMap parentPageProperties;
if (parentPage != null) {
parentPageProperties = parentPage.getProperties();
}
// This tries to get the property 'theme' from the current page. If that fails
// then it tries to get the property from the parent page. If that fails it
// defaults to blank.
theme = properties.get("theme", parentPageProperties.get("theme", ""));
一个快速的解决方案是创建第二组模板/页面组件。假设您有一个模板A,它使用页面组件B作为资源类型:
- 创建模板X并使用allowedParents allowedChildren和allowedPaths属性,以使两者互斥(实际解决方案取决于您的内容体系结构)
- 给X一个与A相同的标题
- 创建扩展B的页面组件Y,并定义它自己的对话框