我能够通过创建一个clientlib来解决这个问题,使用jquery查找元素并手动删除它们。这里是clientlib:
(function(document, $) {
$(document).ready(function(){
var $path = $("[data-type='path']");
var $filetype =$("[data-type='options']");
var $filesize = $("[data-type='filesize']");
if($path.length == 0){
return;
}
//defined in /libs/dam/gui/content/assets/jcr:content/body/content/aside/items/search
var ASSET_RAIL_SEARCH = "#aem-assets-rail-search";
var doSearch = function(){
//$path.remove();
if (window.location.href.indexOf("content/dam/geometrixx/portraits") > -1) {
$filesize.remove();
$filetype.remove();
} else {
// remove custm properties.
}
};
if($.cookie("endor.innerrail.current") == ASSET_RAIL_SEARCH){
doSearch();
}
$(document).on('click', '.js-endor-innerrail-toggle', function(e) {
doSearch();
});
});
})(document, Granite.$);
哪个版本的AEM? – VAr
嗨@VAr,我正在使用AEM 6.1 –
看起来您需要自定义整个搜索表单组件**'(/ libs/granite/ui/components/foundation/contsys)'**功能,因为当前行为不受限制使用坝路径选择过滤器(小平面项目)加载剩余的过滤器(小平面项目),并且所有过滤器(小平面项目)都单独触发Assets(资产)显示。 – VAr