2017-02-22 50 views
0

我有要求在搜索表單下顯示自定義「資產管理搜索軌」。我爲'/ libs/dam/gui/content/facets'創建了一個覆蓋層,並能夠編輯資產搜索方面顯示的字段。如何在AEM中創建新的搜索表單?

現在,當作家是我的項目文件夾中搜索(/內容/大壩/安裝MyApps),在小項目需要與從其他文件夾中搜索(/內容/ DAM)

如何創建是不同的列表一個新的「資產管理搜索軌道」類似於現有的和強制的AEM從相應的壩文件夾開啓時加載正確的表格?

+0

哪個版本的AEM? – VAr

+0

嗨@VAr,我正在使用AEM 6.1 –

+0

看起來您需要自定義整個搜索表單組件**'(/ libs/granite/ui/components/foundation/contsys)'**功能,因爲當前行爲不受限制使用壩路徑選擇過濾器(小平面項目)加載剩餘的過濾器(小平面項目),並且所有過濾器(小平面項目)都單獨觸發Assets(資產)顯示。 – VAr

回答

0

我能夠通過創建一個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.$); 
相關問題