我在页面属性>基本中添加了一个新的选择类型字段“主题”。 现在,如果我在WCM中使用相同的模板添加新页面,那么我也可以获得“主题”选项,这非常明显。 有什么方法可以隐藏子页面中的字段?在CQ如何禁用子页面属性对话框中的任何字段?
P.S这是因为我使用相同的模板的子页面。
我在页面属性>基本中添加了一个新的选择类型字段“主题”。 现在,如果我在WCM中使用相同的模板添加新页面,那么我也可以获得“主题”选项,这非常明显。 有什么方法可以隐藏子页面中的字段?在CQ如何禁用子页面属性对话框中的任何字段?
P.S这是因为我使用相同的模板的子页面。
您不能使用相同的模板并使页面属性对话框不同。
你可以做的是超负荷的对话框
你将不得不包括在页面的JSP代码来获取父页面属性一样的东西:
// 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", ""));
一个快速的解决方案也将创建第二组模板/页组成的。让我们假设你已经有了模板,使用页面组分B为资源类型:
嗨,感谢您的宝贵回复。我以其他方式实现了它。 写一个平行于属性的侦听器,并使用findByType(“selection”)[i] .hide();隐藏该字段。 – OmP 2013-03-26 13:30:32
所以你想要一个属性只能在父页面上编辑,而不能在任何子页面上编辑。你想要该属性继承到子页面? – antonyh 2013-02-22 15:43:15